You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2020/10/29 14:53:40 UTC

[tomcat] branch 8.5.x updated (f0b2ace -> a9e4c87)

This is an automated email from the ASF dual-hosted git repository.

markt pushed a change to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git.


    from f0b2ace  Revert "Restore try catch around Poller.events"
     new 18cfff5  Provide exception messages for SocketTimeoutException
     new a9e4c87  Add bug ID after an issue was opened against an older version

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 java/org/apache/tomcat/util/net/LocalStrings.properties |  3 +++
 java/org/apache/tomcat/util/net/SocketWrapperBase.java  | 15 +++++++++++++--
 webapps/docs/changelog.xml                              |  9 +++++++--
 3 files changed, 23 insertions(+), 4 deletions(-)


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[tomcat] 01/02: Provide exception messages for SocketTimeoutException

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 18cfff56a0ca945c0bc43b033deb8f2480f03301
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Oct 29 14:44:23 2020 +0000

    Provide exception messages for SocketTimeoutException
---
 java/org/apache/tomcat/util/net/LocalStrings.properties |  3 +++
 java/org/apache/tomcat/util/net/SocketWrapperBase.java  | 15 +++++++++++++--
 webapps/docs/changelog.xml                              |  4 ++++
 3 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/LocalStrings.properties b/java/org/apache/tomcat/util/net/LocalStrings.properties
index b6d7861..17c3309 100644
--- a/java/org/apache/tomcat/util/net/LocalStrings.properties
+++ b/java/org/apache/tomcat/util/net/LocalStrings.properties
@@ -132,6 +132,9 @@ socket.apr.write.error=Unexpected error [{0}] writing data to the APR/native soc
 socket.closed=The socket associated with this connection has been closed.
 socket.sslreneg=Exception re-negotiating SSL connection
 
+socketWrapper.readTimeout=Read timeout
+socketWrapper.writeTimeout=Write timeout
+
 sslHostConfig.certificate.notype=Multiple certificates were specified and at least one is missing the required attribute type
 sslHostConfig.certificateVerificationInvalid=The certificate verification value [{0}] is not recognised
 sslHostConfig.fileNotFound=Configured file [{0}] does not exist
diff --git a/java/org/apache/tomcat/util/net/SocketWrapperBase.java b/java/org/apache/tomcat/util/net/SocketWrapperBase.java
index d044a47..dd1da55 100644
--- a/java/org/apache/tomcat/util/net/SocketWrapperBase.java
+++ b/java/org/apache/tomcat/util/net/SocketWrapperBase.java
@@ -1407,13 +1407,13 @@ public abstract class SocketWrapperBase<E> {
                         state.wait(unit.toMillis(timeout));
                         if (state.state == CompletionState.PENDING) {
                             if (handler != null && state.callHandler.compareAndSet(true, false)) {
-                                handler.failed(new SocketTimeoutException(), attachment);
+                                handler.failed(new SocketTimeoutException(getTimeoutMsg(read)), attachment);
                             }
                             return CompletionState.ERROR;
                         }
                     } catch (InterruptedException e) {
                         if (handler != null && state.callHandler.compareAndSet(true, false)) {
-                            handler.failed(new SocketTimeoutException(), attachment);
+                            handler.failed(new SocketTimeoutException(getTimeoutMsg(read)), attachment);
                         }
                         return CompletionState.ERROR;
                     }
@@ -1423,12 +1423,23 @@ public abstract class SocketWrapperBase<E> {
         return state.state;
     }
 
+
+    private String getTimeoutMsg(boolean read) {
+        if (read) {
+            return sm.getString("socketWrapper.readTimeout");
+        } else {
+            return sm.getString("socketWrapper.writeTimeout");
+        }
+    }
+
+
     protected abstract <A> OperationState<A> newOperationState(boolean read,
             ByteBuffer[] buffers, int offset, int length,
             BlockingMode block, long timeout, TimeUnit unit, A attachment,
             CompletionCheck check, CompletionHandler<Long, ? super A> handler,
             Semaphore semaphore, VectoredIOCompletionHandler<A> completion);
 
+
     // --------------------------------------------------------- Utility methods
 
     protected static int transfer(byte[] from, int offset, int length, ByteBuffer to) {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 606603d..7f7caf8 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -91,6 +91,10 @@
         <bug>63362</bug>: Add collection of statistics for HTTP/2, WebSocket and
         connections upgraded via the HTTP upgrade mechanism. (markt)
       </fix>
+      <add>
+        Provide messages for some <code>SocketTimeoutException</code> instances
+        that did not have one. (markt)
+      </add>
     </changelog>
   </subseciton>
   <subsection name="Web applications">


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[tomcat] 02/02: Add bug ID after an issue was opened against an older version

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit a9e4c87db38ac347e3d4f6158fd859db0156997e
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Oct 29 14:45:22 2020 +0000

    Add bug ID after an issue was opened against an older version
---
 webapps/docs/changelog.xml | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 7f7caf8..9d1e1da 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -398,8 +398,9 @@
         provided by Ronny Perinke. (markt)
       </fix>
       <fix>
-        Fix a potential issue where the write lock for a WebSocket connection
-        may not be released if an exception occurs during the write. (markt)
+        <bug>64848</bug>: Fix a potential issue where the write lock for a
+        WebSocket connection may not be released if an exception occurs during
+        the write. (markt)
       </fix>
       <add>
         <bug>64644</bug>: Add support for a read idle timeout and a write idle


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org