Skip to content

fix: sync rows query after error - #3759

Open
foredstudio wants to merge 1 commit into
brianc:masterfrom
foredstudio:foredstudio/fix-rows-error-sync
Open

fix: sync rows query after error#3759
foredstudio wants to merge 1 commit into
brianc:masterfrom
foredstudio:foredstudio/fix-rows-error-sync

Conversation

@foredstudio

Copy link
Copy Markdown

Fixes #3707.

When a query uses the rows option, _getRows sends Flush instead of pipelining Sync. If PostgreSQL returns an ErrorResponse, it ignores subsequent messages until a Sync arrives, so the client can remain permanently stuck waiting for ReadyForQuery.

This sends Sync from handleError only for rows-mode queries, matching the existing rows-mode handling in handleCommandComplete and handleEmptyQuery. Normal queries keep their existing behavior.

Tests added for both rows-mode and normal-query error paths.

Validation:

  • node test/unit/client/query-error-sync-tests.js
  • make test-unit
  • eslint packages/pg/lib/query.js packages/pg/test/unit/client/query-error-sync-tests.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error during a rows-limited query permanently wedges the connection — handleError sends no Sync

1 participant