Skip to content

Serialize remote event requeue on the managed protocol stream - #1311

Open
anli-xsigns wants to merge 1 commit into
FirebirdSQL:masterfrom
anli-xsigns:codex/fix-remote-event-requeue-race
Open

anli-xsigns wants to merge 1 commit into
FirebirdSQL:masterfrom
anli-xsigns:codex/fix-remote-event-requeue-race

Conversation

@anli-xsigns

Copy link
Copy Markdown

Summary

Fixes an internal managed-provider race between synchronous initial remote-event registration and asynchronous automatic re-registration after an event. Both use the event database's main protocol stream. The patch serializes the full request/response exchanges for queue, cancel, and detach operations per GdsDatabase.

Related to #963. This demonstrates one path to the reported ArgumentOutOfRangeException: operation=<number>; it does not claim that all reports in #963 share this cause or change support for application-level parallel commands on one FbConnection.

Reproduction

repros/RemoteEventRequeue/ contains a standalone runner, instructions, and a test-only scheduling probe for the unfixed revision 4385c0fd. With an isolated Firebird 3.0.12 database on port 3051, the probe reproduced ArgumentOutOfRangeException: operation=0 on the first delivered event. The stack went through ProcessOperationAsync, QueueEventsAsync, and StartWaitingForEvents. The publisher uses a separate connection.

Validation

  • Provider and test project compile on .NET 10, with zero compiler warnings/errors.
  • New FbRemoteEventTests integration test stresses event delivery during initial registration and cancellation.
  • Standalone runner on this branch completed 1,000 iterations: 2,029 published, 957 received, zero queue/event/cleanup errors. The in-repo runner was also verified for 100 iterations.
  • The test-only probe is not applied to the production provider code.
  • .NET 11 and the full integration suite were not run locally because the machine has no .NET 11 SDK. Firebird 2.5 was not tested locally.

AI assistance was used to investigate, implement, and document this change; the controlled reproduction and reported builds/runs were executed locally.

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.

1 participant