Fix COPY TO query timeout cleanup - #175
Open
zfaustk wants to merge 2 commits into
Open
Conversation
## Context - Principle: COPY TO terminal paths must notify pg.Client so query timeouts are cleared exactly once. - Why: Real client integration coverage proves timeout cleanup at the user-visible lifecycle boundary. ## Key Deltas - COPY TO integration coverage: direct handler callback stubs -> real pg.Client error and success timeout assertions; why: exercise the timeout lifecycle through the owning client. Key refs: test/copy-to.js:21, test/copy-to.js:108, test/obuf.js:1 ## Verification - Result: passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #156.
pgonly installs itsquery_timeoutcleanup callback on Submittables that expose a callback. COPY FROM already follows that contract, but COPY TO did not, so its timer could remain active after either an error or a successfulReadyForQuery.This mirrors the existing COPY FROM integration by exposing the callback hook and invoking it from both terminal paths. The regression tests exercise error and success cleanup directly without requiring a running PostgreSQL server.
Validation:
npx mocha --v8-expose-gc test/obuf.js— 28 passingnpm run lint— passedgit diff --check— passednpm testwas attempted, but the local PostgreSQL prerequisite was unavailable; both the untouched base and this branch fail in the global setup with the sameECONNREFUSED.AI assistance: Codex was used to inspect the code, implement the change, and run the tests. The final diff and claims are backed by the recorded RED-to-GREEN test output.