fix(query-scheduler): Gracefully terminate reducer connections that do not attempt a connection handshake (fixes #1386).#1389
Merged
Conversation
Contributor
WalkthroughChange _recv_msg_from_reducer to return Optional[bytes] and handle asyncio.IncompleteReadError: if the exception's partial data is empty, log a debug message and return None; if partial data exists, re-raise the exception. Reducer handler short-circuits on None. Signature changed; no other public APIs altered. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Reducer
participant Scheduler as Scheduler::ReducerHandler
Note over Scheduler: Await initial reducer read via _recv_msg_from_reducer
Reducer->>Scheduler: Open connection / send data (or close)
alt Read completes with data (bytes returned)
Scheduler-->>Reducer: Continue normal processing
else asyncio.IncompleteReadError raised
alt err.partial length == 0
Note over Scheduler: Debug log and return None (short-circuit)
Scheduler-->>Reducer: Close handling (no error)
else err.partial length > 0
Note over Scheduler: Re-raise exception (propagate error)
Scheduler-->>Reducer: Error propagated
end
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Contributor
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
components/job-orchestration/job_orchestration/scheduler/query/reducer_handler.py(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: package-image
- GitHub Check: rust-checks (ubuntu-24.04)
- GitHub Check: rust-checks (ubuntu-22.04)
- GitHub Check: rust-checks (macos-15)
- GitHub Check: lint-check (ubuntu-24.04)
gibber9809
approved these changes
Oct 8, 2025
junhaoliao
added a commit
to junhaoliao/clp
that referenced
this pull request
May 17, 2026
…o not attempt a connection handshake (fixes y-scope#1386). (y-scope#1389)
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.
Description
This PR adds graceful handling for empty reducer connections to the query scheduler, by ignoring such benign noises.
Checklist
breaking change.
Validation performed
docker psto find out the instance id of the query-scheduler.docker exec <query-scheduler-id> bash -c '< /dev/tcp/localhost/7000'and observed the command exited successfully.docker logs <query-scheduler-id>and observed no exception logs were printed as before.Summary by CodeRabbit
Bug Fixes
Reliability