Skip to content

Conversation

@SeanTAllen
Copy link
Member

The query state machine only transitioned to _QueryReady when the ReadyForQuery status byte was 'I' (idle). Non-idle statuses ('T' for in-transaction, 'E' for failed transaction) left the state machine in _QueryNotReady, permanently stalling the queue. This made explicit transactions (BEGIN/COMMIT/ROLLBACK) unusable.

ReadyForQuery means the server is ready for the next command regardless of the status byte — the byte is informational, not a readiness gate. Remove the msg.idle() checks from all five query states and always transition to _QueryReady. Also remove the msg parameter from _QueryState.on_ready_for_query since no query state inspects it.

Two new integration tests exercise the fix: Transaction/Commit (exercises status 'T') and Transaction/RollbackAfterFailure (exercises status 'E').

Design: #102

The query state machine only transitioned to _QueryReady when the
ReadyForQuery status byte was 'I' (idle). Non-idle statuses ('T' for
in-transaction, 'E' for failed transaction) left the state machine in
_QueryNotReady, permanently stalling the queue. This made explicit
transactions (BEGIN/COMMIT/ROLLBACK) unusable.

ReadyForQuery means the server is ready for the next command regardless
of the status byte — the byte is informational, not a readiness gate.
Remove the msg.idle() checks from all five query states and always
transition to _QueryReady. Also remove the msg parameter from
_QueryState.on_ready_for_query since no query state inspects it.

Design: #102
@SeanTAllen SeanTAllen added the changelog - fixed Automatically add "Fixed" CHANGELOG entry on merge label Feb 12, 2026
@ponylang-main
Copy link
Contributor

Hi @SeanTAllen,

The changelog - fixed label was added to this pull request; all PRs with a changelog label need to have release notes included as part of the PR. If you haven't added release notes already, please do.

Release notes are added by creating a uniquely named file in the .release-notes directory. We suggest you call the file 105.md to match the number of this pull request.

The basic format of the release notes (using markdown) should be:

## Title

End user description of changes, why it's important,
problems it solves etc.

If a breaking change, make sure to include 1 or more
examples what code would look like prior to this change
and how to update it to work after this change.

Thanks.

@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Feb 12, 2026
@SeanTAllen SeanTAllen merged commit 4b4fb1a into main Feb 12, 2026
8 checks passed
@SeanTAllen SeanTAllen deleted the fix-readyforquery-queue-stall branch February 12, 2026 18:37
@ponylang-main ponylang-main removed the discuss during sync Should be discussed during an upcoming sync label Feb 12, 2026
github-actions bot pushed a commit that referenced this pull request Feb 12, 2026
github-actions bot pushed a commit that referenced this pull request Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog - fixed Automatically add "Fixed" CHANGELOG entry on merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants