Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replacing synchronized blocks with ReentrantLocks in topic-related part of SDK #338

Merged

Conversation

Myllyenko
Copy link

As mentioned in Java's official virtual threads tutorial, synchonized blocks reduce benefits of virtual threads'. In this PR, I've replaced all synchronized blocks in topic-related part of SDK with ReentrantLocks.

@alex268 alex268 requested a review from pnv1 October 27, 2024 10:31
@pnv1
Copy link
Collaborator

pnv1 commented Oct 28, 2024

There was such task in backlog #273
Thank you for the contribution!

@pnv1
Copy link
Collaborator

pnv1 commented Oct 28, 2024

There are currently (style) build issues due to trailing spaces in 4 lines in WriterImpl

@pnv1 pnv1 linked an issue Oct 28, 2024 that may be closed by this pull request
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0% with 76 lines in your changes missing coverage. Please review.

Project coverage is 47.19%. Comparing base (959538e) to head (f887345).
Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
...src/main/java/tech/ydb/topic/impl/SessionBase.java 0.00% 33 Missing ⚠️
...tech/ydb/topic/read/impl/PartitionSessionImpl.java 0.00% 12 Missing ⚠️
.../java/tech/ydb/topic/read/impl/SyncReaderImpl.java 0.00% 11 Missing ⚠️
...ain/java/tech/ydb/topic/write/impl/WriterImpl.java 0.00% 9 Missing ⚠️
...c/read/impl/TransactionMessageAccumulatorImpl.java 0.00% 6 Missing ⚠️
...ech/ydb/topic/read/impl/DeferredCommitterImpl.java 0.00% 5 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #338      +/-   ##
============================================
- Coverage     47.34%   47.19%   -0.16%     
  Complexity     1750     1750              
============================================
  Files           309      311       +2     
  Lines         12463    12499      +36     
  Branches       1232     1238       +6     
============================================
- Hits           5901     5899       -2     
- Misses         6102     6140      +38     
  Partials        460      460              

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

@Myllyenko Myllyenko requested a review from pnv1 October 28, 2024 11:15
@pnv1 pnv1 merged commit 855fab7 into ydb-platform:master Oct 28, 2024
5 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Get rid of synchronized blocks from Topic SDK
3 participants