fix: do not wait for the timeout#140
Conversation
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
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 |
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an issue where job pollers would block unnecessarily by converting the blocking ExtractMin queue operation to a non-blocking one with early cancellation capability. The fix addresses GitHub issue #2194 by introducing an intermediate channel that allows the extraction operation to be cancelled when the plugin is stopped.
- Introduced a new channel
minChto act as a buffer between the blocking queue and non-blocking pollers - Modified the listener to use the new channel-based approach instead of direct queue extraction
- Added an
extractMin()goroutine that continuously feeds jobs from the queue to the channel
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| plugin.go | Added minCh channel field and initialized it during plugin setup |
| listener.go | Implemented extractMin() method and updated listener to use channel-based job consumption |
| go.work.sum | Updated dependency checksums |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
go.work.sumis excluded by!**/*.sum
📒 Files selected for processing (2)
listener.go(2 hunks)plugin.go(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
plugin.go (1)
job.go (1)
Job(7-18)
listener.go (1)
plugin.go (1)
Plugin(49-91)
⏰ 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). (2)
- GitHub Check: Analyze (go)
- GitHub Check: JOBS plugin (Go stable, PHP 8.4, OS ubuntu-latest)
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #140 +/- ##
=============================
=============================
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Reason for This PR
closes: roadrunner-server/roadrunner#2194
Description of Changes
ExtractMincall to a non-blocking (still blocking) call with the possibility to cancel the call early.License Acceptance
By submitting this pull request, I confirm that my contribution is made under
the terms of the MIT license.
PR Checklist
[Author TODO: Meet these criteria.][Reviewer TODO: Verify that these criteria are met. Request changes if not]git commit -s).CHANGELOG.md.Summary by CodeRabbit
Refactor
Bug Fixes
Chores