diff --git a/server/src/main/java/io/deephaven/server/session/SessionService.java b/server/src/main/java/io/deephaven/server/session/SessionService.java index 0af292120b0..86cc84e111f 100644 --- a/server/src/main/java/io/deephaven/server/session/SessionService.java +++ b/server/src/main/java/io/deephaven/server/session/SessionService.java @@ -5,6 +5,7 @@ import com.github.f4b6a3.uuid.UuidCreator; import com.google.protobuf.ByteString; +import com.google.rpc.Code; import io.deephaven.auth.AuthenticationException; import io.deephaven.auth.AuthenticationRequestHandler; import io.deephaven.configuration.Configuration; @@ -383,6 +384,9 @@ public TerminationNotificationListener( @Override void onClose() { + GrpcUtil.safelyExecuteLocked(responseObserver, () -> { + responseObserver.onError(GrpcUtil.statusRuntimeException(Code.UNAUTHENTICATED, "Session has ended")); + }); terminationListeners.remove(this); } diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/WorkerConnection.java b/web/client-api/src/main/java/io/deephaven/web/client/api/WorkerConnection.java index 9e9e9896d3f..6a6e6dbdb7f 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/WorkerConnection.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/WorkerConnection.java @@ -438,8 +438,11 @@ private void subscribeToTerminationNotification() { // restart the termination notification subscribeToTerminationNotification(); return; + } else { + info.notifyConnectionError(Js.cast(fail)); } } + assert success != null; // welp; the server is gone -- let everyone know info.notifyConnectionError(new ResponseStreamWrapper.Status() {