DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG� RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://issues.apache.org/bugzilla/show_bug.cgi?id=35322>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND� INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=35322 [EMAIL PROTECTED] changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW ------- Additional Comments From [EMAIL PROTECTED] 2005-06-13 16:06 ------- Oleg, I apologize for not posting the full contents of the updated isStale() method. Here is the full implementation of the method. If you walk through the code for the situation where inputStream.isAvailable() returns -1 (which is the case with IBM JRE 1.4.1), the new code forces the finally block to execute setSoTimeout which will fail thus returning "true" from the isStale method. With the old code, it never throws exception thus returning "false" from the isStale method. This leaves a closed connection to sit in the pool, which later causes the executeMethod to fail (as shown in the stack trace in the logs attached with the original post). You can simulate the failure by enabling connection pooling, and submitting two requests with a think time of 60sec between them using IBM JRE. That 60sec (may vary with WebServer configuration I guess) will force the connection to go stale. Please let me know if I explained the situation properly or not. Thanks ============================= protected boolean isStale() { boolean isStale = true; if (isOpen) { // the connection is open, but now we have to see if we can read it // assume the connection is not stale. isStale = false; try { try { if (inputStream.available() == 0) { socket.setSoTimeout(1); inputStream.mark(1); int byteRead = inputStream.read(); if (byteRead == -1) { // again - if the socket is reporting all data read, // probably stale isStale = true; } else { inputStream.reset(); } } } finally { socket.setSoTimeout(soTimeout); } } catch (InterruptedIOException e) { // aha - the connection is NOT stale - continue on! } catch (IOException e) { // oops - the connection is stale, the read or soTimeout failed. LOG.debug( "An error occurred while reading from the socket, is appears to be stale", e ); isStale = true; } } return isStale; } ======================================= -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
