fix: Handle window closes correctly in reducestreamer#331
Merged
Conversation
Signed-off-by: Sreekanth <prsreekanth920@gmail.com>
Signed-off-by: Sreekanth <prsreekanth920@gmail.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #331 +/- ##
==========================================
- Coverage 94.20% 94.10% -0.11%
==========================================
Files 66 66
Lines 3091 3137 +46
Branches 162 168 +6
==========================================
+ Hits 2912 2952 +40
- Misses 149 151 +2
- Partials 30 34 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Sreekanth <prsreekanth920@gmail.com>
Signed-off-by: Sreekanth <prsreekanth920@gmail.com>
vigith
approved these changes
Mar 10, 2026
| self.sock_path, | ||
| self.max_threads, | ||
| ) | ||
| _LOGGER.info("Debug build") # FIXME: remove this |
Signed-off-by: Sreekanth <prsreekanth920@gmail.com>
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.
Fixes: #328
When I tried to reproduce the issue, the reducestream UDF was crashing after running for sometime.
Reduce UDF:
When the platform (numa) closes sender end of the bidirectional gRPC stream between sliding window intervals, the in-flight
await queue.get()in the consumer async iterator gets cancelled, raisingasyncio.CancelledError. This is normal gRPC lifecycle — it's how the framework signals "this stream is done."But
ReduceFnhad a blanketexcept BaseExceptionthat caught it.CancelledErroris a subclass ofBaseException(notException), so it was treated as a UDF error.The caught exception was passed to
handle_async_error→exit_on_error→psutil.Process.kill(), which killed the entire Python process. Since a reduce streamer has many concurrent windows/streams active at once, killing the process took down all of them.After the fix:

Also verified UDF exception are reaching UI
