Fix errors not handled when closed
This commit is contained in:
parent
b4c610be08
commit
60474f2a75
@ -772,6 +772,8 @@ public class GrpcServer extends Server {
|
|||||||
if (ex instanceof CompletionException exx) {
|
if (ex instanceof CompletionException exx) {
|
||||||
handleError(responseObserver, exx.getCause());
|
handleError(responseObserver, exx.getCause());
|
||||||
} else {
|
} else {
|
||||||
|
var serverResponseObserver = ((ServerCallStreamObserver<?>) responseObserver);
|
||||||
|
if (!serverResponseObserver.isCancelled()) {
|
||||||
if (ex instanceof RocksDBException e) {
|
if (ex instanceof RocksDBException e) {
|
||||||
responseObserver.onError(Status.INTERNAL
|
responseObserver.onError(Status.INTERNAL
|
||||||
.withDescription(e.getLocalizedMessage())
|
.withDescription(e.getLocalizedMessage())
|
||||||
@ -782,6 +784,9 @@ public class GrpcServer extends Server {
|
|||||||
.withCause(ex)
|
.withCause(ex)
|
||||||
.asException());
|
.asException());
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
LOG.error("Unexpected error", ex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user