Skip to content

Commit 74b39cc

Browse files
authored
Merge pull request #563 from alex268/release_v2.4.0
Fixed deadlock on sync token updating
2 parents 5a59fc3 + cd01dc8 commit 74b39cc

File tree

4 files changed

+8
-47
lines changed

4 files changed

+8
-47
lines changed

core/src/main/java/tech/ydb/core/grpc/YdbHeaders.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,8 @@ public class YdbHeaders {
2222
public static final Metadata.Key<String> YDB_SERVER_HINTS =
2323
Metadata.Key.of("x-ydb-server-hints", Metadata.ASCII_STRING_MARSHALLER);
2424

25+
public static final Metadata.Key<String> AUTH_TICKET =
26+
Metadata.Key.of("x-ydb-auth-ticket", Metadata.ASCII_STRING_MARSHALLER);
27+
2528
private YdbHeaders() { }
2629
}

core/src/main/java/tech/ydb/core/impl/BaseGrpcTransport.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,10 @@ private static Status deadlineExpiredStatus(MethodDescriptor<?, ?> method, GrpcR
222222

223223
private Metadata makeMetadataFromSettings(GrpcRequestSettings settings) {
224224
Metadata metadata = new Metadata();
225+
String token = getAuthCallOptions().getToken();
226+
if (token != null) {
227+
metadata.put(YdbHeaders.AUTH_TICKET, token);
228+
}
225229
if (settings.getTraceId() != null) {
226230
metadata.put(YdbHeaders.TRACE_ID, settings.getTraceId());
227231
}

core/src/main/java/tech/ydb/core/impl/auth/AuthCallOptions.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@ public AuthCallOptions(
4444
authIdentity = null;
4545
}
4646

47-
if (authIdentity != null) {
48-
options = options.withCallCredentials(new YdbCallCredentials(authIdentity));
49-
}
50-
5147
if (builder.getCallExecutor() != null && builder.getCallExecutor() != MoreExecutors.directExecutor()) {
5248
options = options.withExecutor(builder.getCallExecutor());
5349
}
@@ -78,6 +74,7 @@ public CallOptions getGrpcCallOptions() {
7874
if (readTimeoutMillis > 0) {
7975
return callOptions.withDeadlineAfter(readTimeoutMillis, TimeUnit.MILLISECONDS);
8076
}
77+
8178
return callOptions;
8279
}
8380
}

core/src/main/java/tech/ydb/core/impl/auth/YdbCallCredentials.java

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)