Fix timeout overflow when waiting for end of output - #12093
LindseyZ1205 wants to merge 1 commit into
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthrough
ChangesWaitingConsumer timeout
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~8 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to The timeout fix is ready to merge after normal checks. No actionable regression was identified. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
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 |
WaitingConsumer.waitUntilEnd(long, TimeUnit)adds the converted timeout toSystem.nanoTime(). For very large positive timeouts, such asLong.MAX_VALUEnanoseconds or a conversion saturated atLong.MAX_VALUE, the absolute deadline can overflow. On a JVM with a positivenanoTime()value, this immediately throwsTimeoutException, even whenOutputFrame.ENDis already queued.Compare elapsed time against the timeout instead, matching the existing
waitUntilimplementation. The no-argument overload now also uses a relative timeout. No public API changes.Regression coverage includes maximum and saturated timeouts, the no-argument overload, an ordinary finite timeout, and expiration without an END frame.
Validation: the original source fails both large-timeout regression cases (2 failures out of 5 tests). With this change, all 5 WaitingConsumer tests and 12 FrameConsumerResultCallback tests pass. Module checkstyleMain, checkstyleTest, and spotlessApply pass. Full
./gradlew checkand Docker integration tests were not run because the local Docker daemon is unavailable.AI assistance: Codex assisted with investigation, implementation, and regression tests.
Summary by CodeRabbit