Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Rolled back my failed experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
pfrank13 committed Sep 24, 2023
1 parent 4591cee commit 5a428aa
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ class WsStateAwaiting {
private String method;
private List<Object> params;
private SubscriptionHandler subscription;
private Map<String, String> mdc;
}

@Slf4j
Expand Down Expand Up @@ -237,7 +236,7 @@ private CompletableFuture<RpcObject> send(String method,
log.debug("Calling {} {}, {}, {}, {}", id, method, params, json, subscription);

val whenResponseReceived = new CompletableFuture<RpcObject>();
this.handlers.put(id, new WsStateAwaiting(whenResponseReceived, method, params, subscription, MDC.getCopyOfContextMap()));
this.handlers.put(id, new WsStateAwaiting(whenResponseReceived, method, params, subscription));

return CompletableFuture.runAsync(() -> ws.send(json), webSocketSendExecutorService)
.whenCompleteAsync((_res, ex) -> {
Expand Down Expand Up @@ -436,7 +435,6 @@ private void onSocketMessageResult(JsonRpcResponseSingle response) {
}

try {
MDC.setContextMap(handler.getMdc());
val result = response.getResult();
// first send the result - in case of subs, we may have an update
// immediately if we have some queued results already
Expand All @@ -461,8 +459,6 @@ private void onSocketMessageResult(JsonRpcResponseSingle response) {
}
} catch (Exception ex) {
handler.getCallback().completeExceptionally(ex);
}finally{
MDC.clear();
}

this.handlers.remove(id);
Expand Down

0 comments on commit 5a428aa

Please sign in to comment.