This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push:
new fd1df16c14 Additional logging to help debug a GitHub action failure
fd1df16c14 is described below
commit fd1df16c14eca57609e811b54c7e0397340a95ec
Author: Mark Thomas <[email protected]>
AuthorDate: Wed Jul 24 13:00:35 2024 +0100
Additional logging to help debug a GitHub action failure
---
java/org/apache/tomcat/websocket/LocalStrings.properties | 2 ++
java/org/apache/tomcat/websocket/WsRemoteEndpointImplClient.java | 7 +++++++
2 files changed, 9 insertions(+)
diff --git a/java/org/apache/tomcat/websocket/LocalStrings.properties
b/java/org/apache/tomcat/websocket/LocalStrings.properties
index 0998319ddb..0f6b97186a 100644
--- a/java/org/apache/tomcat/websocket/LocalStrings.properties
+++ b/java/org/apache/tomcat/websocket/LocalStrings.properties
@@ -109,6 +109,8 @@ wsRemoteEndpoint.tooMuchData=Ping or pong may not send more
than 125 bytes
wsRemoteEndpoint.writeTimeout=Blocking write timeout
wsRemoteEndpoint.wrongState=The remote endpoint was in state [{0}] which is an
invalid state for called method
+wsRemoteEndpointClient.writeFailed=Write to the remote endpoint failed. The
timeout passed to this method was [{0}] and the timeout used for the write was
[{1}]
+
# Note the following messages are used as a close reason in a WebSocket control
# frame and therefore must be 123 bytes (not characters) or less in length.
# Messages are encoded using UTF-8 where a single character may be encoded in
diff --git a/java/org/apache/tomcat/websocket/WsRemoteEndpointImplClient.java
b/java/org/apache/tomcat/websocket/WsRemoteEndpointImplClient.java
index 7b0386224d..9670297f1f 100644
--- a/java/org/apache/tomcat/websocket/WsRemoteEndpointImplClient.java
+++ b/java/org/apache/tomcat/websocket/WsRemoteEndpointImplClient.java
@@ -26,8 +26,13 @@ import java.util.concurrent.locks.ReentrantLock;
import jakarta.websocket.SendHandler;
import jakarta.websocket.SendResult;
+import org.apache.juli.logging.Log;
+import org.apache.juli.logging.LogFactory;
+
public class WsRemoteEndpointImplClient extends WsRemoteEndpointImplBase {
+ private final Log log =
LogFactory.getLog(WsRemoteEndpointImplClient.class); // must not be static
+
private final AsyncChannelWrapper channel;
private final ReentrantLock lock = new ReentrantLock();
@@ -63,6 +68,8 @@ public class WsRemoteEndpointImplClient extends
WsRemoteEndpointImplBase {
try {
channel.write(byteBuffer).get(timeout, TimeUnit.MILLISECONDS);
} catch (InterruptedException | ExecutionException |
TimeoutException e) {
+ log.warn(sm.getString("wsRemoteEndpointClient.writeFailed",
Long.valueOf(blockingWriteTimeoutExpiry),
+ Long.valueOf(timeout)), e);
handler.onResult(new SendResult(getSession(), e));
return;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]