Skip to content

Fixed deadlock between MessageCommitter/SessionBase#666

Merged
alex268 merged 2 commits into
ydb-platform:masterfrom
alex268:master
Jun 15, 2026
Merged

Fixed deadlock between MessageCommitter/SessionBase#666
alex268 merged 2 commits into
ydb-platform:masterfrom
alex268:master

Conversation

@alex268

@alex268 alex268 commented Jun 15, 2026

Copy link
Copy Markdown
Member

No description provided.

@robot-vibe-db

robot-vibe-db Bot commented Jun 15, 2026

Copy link
Copy Markdown

@alex268 Please set up your personal token, see instructions: https://nda.ya.ru/t/dur-L1y77biDC2

@codecov-commenter

codecov-commenter commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 22.22222% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.59%. Comparing base (a402f6f) to head (e7f2a87).

Files with missing lines Patch % Lines
...tech/ydb/topic/read/impl/MessageCommitterImpl.java 22.22% 5 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #666      +/-   ##
============================================
- Coverage     71.61%   71.59%   -0.03%     
  Complexity     3426     3426              
============================================
  Files           386      386              
  Lines         16066    16071       +5     
  Branches       1687     1688       +1     
============================================
  Hits          11506    11506              
- Misses         3904     3909       +5     
  Partials        656      656              

☔ 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.

@alex268 alex268 requested a review from pnv1 June 15, 2026 16:35
@pnv1 pnv1 requested a review from Copilot June 15, 2026 17:36
pnv1
pnv1 previously approved these changes Jun 15, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to eliminate a deadlock between MessageCommitterImpl and the underlying session (via SessionBase) by changing the ordering of the commit request vs. internal commit-future bookkeeping.

Changes:

  • Moves commitOffsets(...) invocation outside of commitFuturesLock in MessageCommitterImpl.commit(...).
  • Simplifies the commit path by removing the conditional insertion into commitFutures under the lock.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread topic/src/main/java/tech/ydb/topic/read/impl/MessageCommitterImpl.java Outdated
@robot-vibe-db

robot-vibe-db Bot commented Jun 15, 2026

Copy link
Copy Markdown

AI Review Summary

Verdict: ✅ No critical issues found

Critical issues

No critical issues found.

Other findings

  • Minor | Medium: Unconditional commitFutures.remove(range.getEnd()) in the failure path may remove a future belonging to a different concurrent commit() call that reused the same key — MessageCommitterImpl.java:87
  • Minor | Low: future.completeExceptionally() outside the lock (line 83) races with confirmCommit completing the same future via future.complete(null) — both are safe individually (CompletableFuture is thread-safe), but the caller could observe success or failure non-deterministically if commitOffsets returns false while a confirmation for the same offset is in-flight — MessageCommitterImpl.java:83
  • Nit | Medium: No unit test covering the deadlock or the data-race scenario — the fix is correct but regressions would be hard to catch — MessageCommitterImpl.java:64

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 Jun 15, 2026

Copy link
Copy Markdown

Full analysis log

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

@alex268 alex268 merged commit bc004e1 into ydb-platform:master Jun 15, 2026
11 checks passed
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.

4 participants