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:48:34 UTC

[tomcat] branch master updated (717387f -> 9db8adb)

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

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


    from 717387f  Add dedicated handling and warn for a null socket channel
     new 3ecb663  Provide exception messages for SocketTimeoutException
     new 9db8adb  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 master
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 3ecb6633ff958812635f36a0d1274adba5b0ef1b
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 a6a376a..1de8916 100644
--- a/java/org/apache/tomcat/util/net/LocalStrings.properties
+++ b/java/org/apache/tomcat/util/net/LocalStrings.properties
@@ -154,6 +154,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 ad7d1e3..06fea5f 100644
--- a/java/org/apache/tomcat/util/net/SocketWrapperBase.java
+++ b/java/org/apache/tomcat/util/net/SocketWrapperBase.java
@@ -1395,13 +1395,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;
                     }
@@ -1411,12 +1411,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 f5adf81..a2414ab 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -112,6 +112,10 @@
         the NIO poller thread to exit. This is a regression caused when
         the Poller.events method was refactored. (remm)
       </fix>
+      <add>
+        Provide messages for some <code>SocketTimeoutException</code> instances
+        that did not have one. (markt)
+      </add>
     </changelog>
   </subsection>
   <subsection name="Jasper">


---------------------------------------------------------------------
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 master
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 9db8adbb3da30173c26c55b83c00cd65b6d2aa34
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 a2414ab..68031ff 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -511,8 +511,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