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 core part of SDK #341

Merged

Conversation

Myllyenko
Copy link

Continuation of #338

}
}

@Override
public void onClose(io.grpc.Status status, @Nullable Metadata trailers) {
if (logger.isTraceEnabled()) {
logger.trace("ReadWriteStreamCall[{}] closed with status {}", status);
logger.trace("ReadWriteStreamCall[{}] closed with status {}", traceId, status);
Copy link
Author

Choose a reason for hiding this comment

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

First log argument was absent

@codecov-commenter
Copy link

codecov-commenter commented Oct 29, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 6 lines in your changes missing coverage. Please review.

Project coverage is 47.21%. Comparing base (9a7adfa) to head (863193b).

Files with missing lines Patch % Lines
...src/main/java/tech/ydb/core/impl/YdbDiscovery.java 70.58% 4 Missing and 1 partial ⚠️
...a/tech/ydb/core/impl/call/ReadWriteStreamCall.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #341      +/-   ##
============================================
+ Coverage     47.19%   47.21%   +0.01%     
  Complexity     1750     1750              
============================================
  Files           311      311              
  Lines         12499    12499              
  Branches       1238     1238              
============================================
+ Hits           5899     5901       +2     
+ Misses         6140     6138       -2     
  Partials        460      460              

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

@pnv1 pnv1 requested a review from alex268 October 29, 2024 14:28
@alex268
Copy link
Member

alex268 commented Oct 29, 2024

I am not sure that we have to remove synchronized from call classes. They are just simple wrappers on GrpcCall and all their calls are not blocking. In this case, synchronized just adds thread safety to GrpcCall, especially with case data race on start() and cancel(). Replacing them by ReentrantLock makes them more complex and may reduce a performance

@Myllyenko
Copy link
Author

I am not sure that we have to remove synchronized from call classes. They are just simple wrappers on GrpcCall and all their calls are not blocking. In this case, synchronized just adds thread safety to GrpcCall, especially with case data race on start() and cancel(). Replacing them by ReentrantLock makes them more complex and may reduce a performance

Reverted changes in StreamCalls.

@alex268 alex268 merged commit fe3af55 into ydb-platform:master Oct 30, 2024
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.

4 participants