File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed
query/src/main/java/tech/ydb/query/impl Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,11 @@ abstract class SessionImpl implements QuerySession {
5858 YdbQuery .DeleteSessionResponse ::getStatus , YdbQuery .DeleteSessionResponse ::getIssuesList
5959 );
6060
61+ private static final Status CANCELLED = Status .of (
62+ StatusCode .CLIENT_CANCELLED ,
63+ Issue .of ("Stream was cancelled by client, session will be removed" , Issue .Severity .WARNING )
64+ );
65+
6166 private final QueryServiceRpc rpc ;
6267 private final String sessionId ;
6368 private final long nodeID ;
@@ -313,6 +318,7 @@ public CompletableFuture<Result<QueryInfo>> execute(PartsHandler handler) {
313318
314319 @ Override
315320 public void cancel () {
321+ updateSessionState (CANCELLED );
316322 grpcStream .cancel ();
317323 }
318324 }
Original file line number Diff line number Diff line change @@ -175,6 +175,7 @@ public void updateSessionState(Status status) {
175175 status .getCode () == StatusCode .INTERNAL_ERROR ||
176176 status .getCode () == StatusCode .CLIENT_DEADLINE_EXCEEDED ||
177177 status .getCode () == StatusCode .CLIENT_DEADLINE_EXPIRED ||
178+ status .getCode () == StatusCode .CLIENT_CANCELLED ||
178179 status .getCode () == StatusCode .TRANSPORT_UNAVAILABLE ;
179180 if (isStatusBroken ) {
180181 logger .warn ("QuerySession[{}] broken with status {}" , getId (), status );
You can’t perform that action at this time.
0 commit comments