Skip to content

Fix/discovery wait ready time units - #698

Open
alex268 wants to merge 2 commits into
ydb-platform:masterfrom
alex268:fix/discovery-wait-ready-time-units
Open

Fix/discovery wait ready time units#698
alex268 wants to merge 2 commits into
ydb-platform:masterfrom
alex268:fix/discovery-wait-ready-time-units

Conversation

@alex268

@alex268 alex268 commented Aug 12, 2026

Copy link
Copy Markdown
Member

No description provided.

Igor Melnichenko and others added 2 commits August 6, 2026 00:15
YdbTransportImpl.getChannel computed the time left until the request
deadline in nanoseconds (deadlineAfter is a System.nanoTime() value) and
passed it to YdbDiscovery.waitReady(long millis), which awaits on a
Condition with MILLISECONDS. A 5 second deadline therefore became a wait
of roughly 57 days, so any request issued before the endpoint pool was
populated blocked indefinitely instead of failing at its own deadline.

@robot-vibe-db robot-vibe-db Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI Review Summary

Verdict: ✅ No critical issues found

Critical issues

No critical issues found.

Other findings

  • Minor | Medium: When leftNanos is positive but < 1,000,000 (sub-millisecond remaining), toMillis() truncates to 0 and the Math.max(..., 1) clamp gives a 1ms wait window. This is arguably the right trade-off (avoids default-timeout fallback), but the request deadline will have expired by the time prepareCallOptions runs, so the call returns CLIENT_DEADLINE_EXPIRED regardless. No action needed — noting for completeness. — core/src/main/java/tech/ydb/core/impl/YdbTransportImpl.java:144
  • Nit | Low: The test asserts elapsed < discoveryTimeout (5s) but the actual expected behavior is ~50ms. A tighter upper bound (e.g., Duration.ofSeconds(2)) would catch regressions where the wait is shorter than the full discovery timeout but still far longer than the request deadline. Current assertion is safe for CI. — core/src/test/java/tech/ydb/core/impl/YdbTransportImplTest.java:217

This review was generated automatically. Critical issues require attention; other findings are advisory.
If this comment was useful, please give it a 👍 — it helps us improve the review bot.

@robot-vibe-db

robot-vibe-db Bot commented Aug 12, 2026

Copy link
Copy Markdown

Full analysis log

Analysis performed by claude, claude-opus-4-6.

@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 72.00%. Comparing base (d876581) to head (1cc23c7).
⚠️ Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
...main/java/tech/ydb/core/impl/YdbTransportImpl.java 75.00% 1 Missing ⚠️

❌ Your patch check has failed because the patch coverage (75.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #698      +/-   ##
============================================
+ Coverage     71.91%   72.00%   +0.09%     
- Complexity     3474     3497      +23     
============================================
  Files           390      391       +1     
  Lines         16220    16277      +57     
  Branches       1698     1705       +7     
============================================
+ Hits          11664    11721      +57     
+ Misses         3904     3903       -1     
- Partials        652      653       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant