Skip to content

Commit 78ecf1c

Browse files
authored
Merge pull request #299 from alex268/master
Fixed NPE and logs
2 parents 6cd96eb + 38b376b commit 78ecf1c

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

core/src/main/java/tech/ydb/core/impl/call/ReadStreamCall.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public void onMessage(RespT message) {
114114
@Override
115115
public void onClose(io.grpc.Status status, @Nullable Metadata trailers) {
116116
if (logger.isTraceEnabled()) {
117-
logger.trace("ReadStreamCall[{}] closed with status {}", status);
117+
logger.trace("ReadStreamCall[{}] closed with status {}", traceId, status);
118118
}
119119

120120
statusConsumer.accept(status, trailers);

query/src/main/java/tech/ydb/query/impl/SessionImpl.java

+7-3
Original file line numberDiff line numberDiff line change
@@ -275,12 +275,16 @@ public CompletableFuture<Result<QueryInfo>> execute(PartsHandler handler) {
275275
handleTxMeta(msg.getTxMeta());
276276
}
277277
if (issues.length > 0) {
278-
handler.onIssues(issues);
278+
if (handler != null) {
279+
handler.onIssues(issues);
280+
} else {
281+
logger.trace("{} lost issues message", SessionImpl.this);
282+
}
279283
}
280284
if (msg.hasExecStats()) {
281285
QueryStats old = stats.getAndSet(new QueryStats(msg.getExecStats()));
282286
if (old != null) {
283-
logger.warn("{} got lost previous exec stats {}", SessionImpl.this, old);
287+
logger.warn("{} lost previous exec stats {}", SessionImpl.this, old);
284288
}
285289
}
286290

@@ -289,7 +293,7 @@ public CompletableFuture<Result<QueryInfo>> execute(PartsHandler handler) {
289293
if (handler != null) {
290294
handler.onNextPart(new QueryResultPart(index, msg.getResultSet()));
291295
} else {
292-
logger.warn("{} got lost result set part with index {}", SessionImpl.this, index);
296+
logger.trace("{} lost result set part with index {}", SessionImpl.this, index);
293297
}
294298
}
295299
}).whenComplete((status, th) -> {

0 commit comments

Comments
 (0)