Skip to content

Commit

Permalink
fix fabric8io#4891: removing the backpressue for close
Browse files Browse the repository at this point in the history
  • Loading branch information
shawkins committed Feb 17, 2023
1 parent f701b7b commit c3b0348
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* Fix #4823: (java-generator) handle special characters in field names
* Fix #4723: [java-generator] Fix a race in the use of JavaParser hitting large CRDs
* Fix #4885: addresses a potential hang in the jdk client with exec stream reading
* Fix #4891: address vertx not completely reading exec streams

#### Improvements
* Fix #3805: DeletionTimestamp and Finalizer support in Mock server.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ public void onWebSocketText(String message) {
@Override
public void onWebSocketClose(int statusCode, String reason) {
closed.set(true);
backPressure();
listener.onClose(this, statusCode, reason);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ private void request() {

@Override
public void onClosing(okhttp3.WebSocket webSocket, int code, String reason) {
awaitMoreRequest();
listener.onClose(new OkHttpWebSocketImpl(webSocket, this::request), code, reason);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ default void onOpen(WebSocket webSocket) {

/**
* Called once the full text message has been built. {@link WebSocket#request()} must
* be called to receive more messages or onClose.
* be called to receive more messages.
*/
default void onMessage(WebSocket webSocket, String text) {
webSocket.request();
}

/**
* Called once the full binary message has been built. {@link WebSocket#request()} must
* be called to receive more messages or onClose.
* be called to receive more messages.
*/
default void onMessage(WebSocket webSocket, ByteBuffer bytes) {
webSocket.request();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,22 +358,24 @@ private void handleExitStatus(ByteBuffer bytes) {

@Override
public void onClose(WebSocket webSocket, int code, String reason) {
if (!exitCode.isDone()) {
exitCode.complete(null);
}
closeWebSocketOnce(code, reason);
//If we already called onClosed() or onFailed() before, we need to abort.
if (!closed.compareAndSet(false, true)) {
return;
}
LOGGER.debug("Exec Web Socket: On Close with code:[{}], due to: [{}]", code, reason);
try {
cleanUpOnce();
} finally {
if (listener != null) {
listener.onClose(code, reason);
serialExecutor.execute(() -> {
try {
if (!exitCode.isDone()) {
exitCode.complete(null);
}
cleanUpOnce();
} finally {
if (listener != null) {
listener.onClose(code, reason);
}
}
}
});
}

@Override
Expand Down

0 comments on commit c3b0348

Please sign in to comment.