feat: bidirectional StorageController communication with finalize ack#1129
Closed
vringar wants to merge 3 commits intorefactor/event-driven-completionfrom
Closed
feat: bidirectional StorageController communication with finalize ack#1129vringar wants to merge 3 commits intorefactor/event-driven-completionfrom
vringar wants to merge 3 commits intorefactor/event-driven-completionfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## refactor/event-driven-completion #1129 +/- ##
====================================================================
+ Coverage 35.25% 39.10% +3.85%
====================================================================
Files 39 39
Lines 3617 3657 +40
====================================================================
+ Hits 1275 1430 +155
+ Misses 2342 2227 -115 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
e8a8d80 to
3dd59e3
Compare
31054e1 to
e450b63
Compare
3dd59e3 to
2e0ca20
Compare
2e0ca20 to
8bda197
Compare
e450b63 to
09e5fc7
Compare
After processing a finalize message, the StorageController now sends an ack message back on the StreamWriter to the client that sent it. This enables bidirectional communication.
DataSocket.finalize_visit_id_with_ack() sends a finalize message and waits for an acknowledgment from the StorageController. This replaces the fixed sleep in FinalizeCommand with event-driven confirmation that data has been processed.
TaskManager.finalize_visit_id now waits for a StorageController ack, confirming data has been processed before returning. Falls back gracefully on timeout.
09e5fc7 to
8a2744c
Compare
8bda197 to
2bc92b9
Compare
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.
Summary
send_to_writer()tosocket_interface.pyfor sending messages on asyncio StreamWritersClientSocket.receive()for receiving messages on an existing connectionfinalize_ackback on the StreamWriter after processing a finalize, but only when the client setswant_ack: TrueDataSocket.finalize_visit_id_with_ack()that sends withwant_ackand waits for the ack (with timeout fallback)OSErroralongsideIncompleteReadErrorto handle transport poisoning from failed writesAcks are opt-in (
want_ackflag) because writing to a closed connection poisons the shared asyncio transport, preventing reads of remaining buffered messages. Onlyfinalize_visit_id_with_acksets this flag; fire-and-forget callers (extension, tests) are unaffected.Stacked on #1128.