model-writtenrun 29 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Matt Carter reported substantial memory growth during repeated libpq 16 connections in #1; Tom Lane could not reproduce it with a simple C client and requested connection and authentication details in #2.
- Matt identified Kerberos authentication in #3, and Andres Freund recommended allocation tracing in #5; tests that removed SQLAlchemy or disabled GSS encryption still leaked in #6, initially leading Matt to report the issue to psycopg2 in #7.
- Returning months later, Matt demonstrated in #8 that repeated GSS authentication rounds overwrote unreleased credentials, supplied an inline guard, and measured the fix on libpq 16 and 18; disabling GSS encryption had never disabled the authentication path responsible for the leak.
- Tom broadened the fix in #9, replacing the misleading pg_GSS_have_cred_cache() API with pg_GSS_get_cred_cache(), guarding credential reuse in connection negotiation, and explicitly initializing the credential handle; Matt confirmed the fix's memory and authentication behavior in #10.
- Tom found additional delegation inconsistencies and revised pg_GSS_continue() in #11 to acquire credentials only for enabled delegation and set the delegation flag only after successful acquisition; Matt tested the final version across delegation and encryption settings in #12, while noting that his server could not verify receipt of delegated credentials.
- After accepting those results in #13, Tom committed the final patch as 72216a2454, with connection-flow adaptations for the supplied candidate's older branch and backpatch coverage through PostgreSQL 16.
- After the commit, Jacob Champion questioned the changed delegation behavior and the necessity of explicit credential acquisition in #14; Tom defended consistency with the encryption path and reported test coverage in #15.
- Jacob explained that GSS_C_NO_CREDENTIAL selects default credentials and cited the requirement to preserve credentials across authentication rounds in #16; the thread ended with Tom acknowledging unresolved questions about acquisition paths and inadequate documentation in #17, with the fix landed and no further patch or revert shown.