fix: map stream can ack inflight messages during panic and tests#3267
Open
vaibhavtiwari33 wants to merge 7 commits intomainfrom
Open
fix: map stream can ack inflight messages during panic and tests#3267vaibhavtiwari33 wants to merge 7 commits intomainfrom
vaibhavtiwari33 wants to merge 7 commits intomainfrom
Conversation
…st suite Signed-off-by: Vaibhav Tiwari <vaibhav.tiwari33@gmail.com>
Signed-off-by: Vaibhav Tiwari <vaibhav.tiwari33@gmail.com>
Signed-off-by: Vaibhav Tiwari <vaibhav.tiwari33@gmail.com>
Signed-off-by: Vaibhav Tiwari <vaibhav.tiwari33@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3267 +/- ##
==========================================
+ Coverage 80.97% 81.01% +0.03%
==========================================
Files 316 316
Lines 72203 72370 +167
==========================================
+ Hits 58468 58627 +159
- Misses 13182 13190 +8
Partials 553 553 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
What this PR does / why we need it
To track down where the ACKing of a message is happening when the map stream panics, we added a stack trace for whenever a message is acked when dropped:
During the run of
test_threaded_stream_with_panictest we see the following trace:So, the ack is being called right after there was a call to drop
ParentMessageInfo, which means there were no other references to the AckHandleat ./src/mapper/map/stream.rs:142:5.There are three possibilities for the AckHandle to be dropped here through
ParentMessageInfo, which basically are the three match cases:Some(Ok(results)) =>: We know that this case can never happen for the panicking test since the map stream UDF will always panic and won't return any results, soParentMessageInfocannot be dropping after this.Some(Err(e)) =>: If this case would've triggered then theparent_infowould've set the ack handle to nack when dropped.None =>: This seems to be the only viable option where if we match this case then theParentMessageInfocan drop without Nacking the AckHandle.Following the above-mentioned scenario, a message was sent to the map stream server, but instead of getting any response, the gRPC channel got closed (this needs more digging).
So, the current fix (hack) is that since we track and increment the
current_indexas part of the parent_info when a message is processed, we can Nack any messages where the channel got closed but the parent info's current_index remained 0.Related issues
Fixes #3244
Fixes #3268
Testing
The panic tests added for map stream now pass.