You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2013/07/02 02:01:40 UTC

[Bug 55180] New: connectionTimeout="-1" causes timeout can't be negative

https://issues.apache.org/bugzilla/show_bug.cgi?id=55180

            Bug ID: 55180
           Summary: connectionTimeout="-1" causes timeout can't be
                    negative
           Product: Tomcat 7
           Version: 7.0.30
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Connectors
          Assignee: dev@tomcat.apache.org
          Reporter: jmwmj208@163.com

I configured server.xml like this:
connectionTimeout="-1" disableUploadTimeout="false"
connectionUploadTimeout="200"
(maybe it is stupid to configure like this,if connectionTimeout=-1,can i make
disableUploadTimeout=false?).
It will cause :

java.lang.IllegalArgumentException: timeout can't be negative
    at sun.nio.ch.SocketAdaptor.setSoTimeout(SocketAdaptor.java:361)
    at
org.apache.coyote.http11.Http11NioProcessor.setSocketTimeout(Http11NioProcessor.java:251)
......
because of :
      if (!disableUploadTimeout) {
//endpoint.getSoTimeout()=-1.
           setSocketTimeout(endpoint.getSoTimeout());
       }

~~~~~~~~~~~~~~~~~~~~~~~~~
another thing:
if i configure connectionTimeout="0". 
in NioBlockingSelector.read(ByteBuffer buf, NioChannel socket, long
readTimeout),readTimeout = 0, in case socket.read(buf) == 0, it make
timeout=true.
if (readTimeout >= 0 && (keycount == 0))
    timedout = (System.currentTimeMillis() - time) >= readTimeout;
then throw the SocketTimeoutException().

thank you.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 55180] connectionTimeout="-1" causes timeout can't be negative

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55180

Violeta Georgieva <vi...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
                 OS|                            |All

--- Comment #2 from Violeta Georgieva <vi...@apache.org> ---
Hi,

Thanks for the report and the patch. It was applied to trunk and 7.0.x and will
be included in 7.0.42 onwards.


For the second problem you are facing Bug 55160. Instead of
connectionUploadTimeout, connectionTimeout was set as readTimeout.

Regards
Violeta

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 55180] connectionTimeout="-1" causes timeout can't be negative

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55180

--- Comment #3 from Roger Wang <jm...@163.com> ---
excuse me, I think the second problem is different from the bug 55160.
because when connectionTimeout="0" disableUploadTimeout="true".
it will always throw socketTimeoutException if read ==0 (socket.read(buf)).
Thank you very much for your fixing.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 55180] connectionTimeout="-1" causes timeout can't be negative

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55180

--- Comment #4 from Violeta Georgieva <vi...@apache.org> ---
(In reply to Roger Wang from comment #3)
> excuse me, I think the second problem is different from the bug 55160.
> because when connectionTimeout="0" disableUploadTimeout="true".
> it will always throw socketTimeoutException if read ==0 (socket.read(buf)).
> Thank you very much for your fixing.

Please open a new bug for this particular problem.

Thanks
Violeta

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 55180] connectionTimeout="-1" causes timeout can't be negative

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55180

--- Comment #1 from Nick Bunn <th...@gmail.com> ---
Created attachment 30519
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=30519&action=edit
fix

Attached the patch to fix the first issue. 

Might need to discuss why it was chose to make -1 the infiniti timeout. When in
the socket class 0 is infiniti. I'm sure there is good reason. Just a thought.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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