Bug 55160

Summary: NIO connectionUploadTimeout can't work
Product: Tomcat 7 Reporter: Roger Wang <jmwmj208>
Component: ConnectorsAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 7.0.30   
Target Milestone: ---   
Hardware: PC   
OS: All   

Description Roger Wang 2013-06-29 21:35:09 UTC
when i configure disableUploadTimeout="false" and connectionTimeout="20000" ,connectionUploadTimeout="30000" .
I found the connectionUploadTimeout doesn't work, because the code in internalNioInputBuffer.readSocket():
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
try {
                NioEndpoint.KeyAttachment att = (NioEndpoint.KeyAttachment)socket.getAttachment(false);
                if ( att == null ) throw new IOException("Key must be cancelled.");
                nRead = pool.read(socket.getBufHandler().getReadBuffer(),socket,selector,att.getTimeout());
            } catch ( EOFException eof ) {
                nRead = -1;
            } finally { 
                if ( selector != null ) pool.put(selector);
            }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
att.getTimeout() is the connectionTimeout ,not the connectionUploadTimeout.
so , in NioBlockingSelector.read(), the readTimeout is connectionTimeout
Comment 1 Mark Thomas 2013-07-01 14:29:00 UTC
Thanks for the report.

This has been fixed in trunk and 7.0.x and will be included in 7.0.42 onwards.