From b674e052966770767561044d2563c921b867177f Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Wed, 8 Nov 2023 12:17:09 -0800 Subject: [PATCH] Don't remove state until after onCreationResponse is successful --- .../src/main/java/io/deephaven/client/impl/ExportStates.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/java-client/session/src/main/java/io/deephaven/client/impl/ExportStates.java b/java-client/session/src/main/java/io/deephaven/client/impl/ExportStates.java index d9d11f1fc4e..3f540c0681c 100644 --- a/java-client/session/src/main/java/io/deephaven/client/impl/ExportStates.java +++ b/java-client/session/src/main/java/io/deephaven/client/impl/ExportStates.java @@ -398,11 +398,12 @@ public void onNext(ExportedTableCreationResponse value) { "Not expecting export creation responses for empty tickets"); } final int exportId = ExportTicketHelper.ticketToExportId(value.getResultId().getTicket(), "export"); - final State state = newStates.remove(exportId); + final State state = newStates.get(exportId); if (state == null) { throw new IllegalStateException("Unable to find state for creation response"); } state.onCreationResponse(value); + newStates.remove(exportId, state); } @Override