https://bz.apache.org/bugzilla/show_bug.cgi?id=62799

--- Comment #1 from Rainer Jung <rainer.j...@kippdata.de> ---
Hi Mark,

just to make sure: did you notice that the unit of socket_connect_timeout is
milliseconds, so did you set it to 5000?

In version 1.2.44 it switched to seconds due to a regression which will be
fixed in the forthcoming 1.2.46, switching back to milliseconds.

Furthermore: which platform is this? And do you have a socket_timeout
configured in addition (not recommending it, just asking)?

I do not directly see any relevance of the event MPM here. The connection in
question is the backend connection completely controlled by mod_jk.

Furthermore, EINPROGRESS is already handled in the code. There might be a
problem in that handling, but I don't immediately see it.

If you can easily reproduce it, it would be interesting to see, where in the
following block of code we actually leave nb_connect() in common/jk_connect.c:

 284     if ((rc == -1) && (errno == EINPROGRESS || errno == EALREADY)
 285                    && (timeout > 0)) {
Do we get in here and what is the value of errno?
 286         fd_set wfdset;
 287         struct timeval tv;
 288         socklen_t rclen = (socklen_t)sizeof(rc);
 289
 290         FD_ZERO(&wfdset);
 291         FD_SET(sd, &wfdset);
 292         tv.tv_sec = timeout / 1000;
 293         tv.tv_usec = (timeout % 1000) * 1000;
 294         rc = select(sd + 1, NULL, &wfdset, NULL, &tv);
 295         if (rc <= 0) {
Do we get in here and what is the value of errno?
 296             /* Save errno */
 297             int err = errno;
 298             soblock(sd);
 299             errno = err;
 300             JK_TRACE_EXIT(l);
 301             return -1;
 302         }
 303         rc = 0;
 304 #ifdef SO_ERROR
Do we get in here?
 305         if (!FD_ISSET(sd, &wfdset) ||
 306             (getsockopt(sd, SOL_SOCKET, SO_ERROR,
 307                         (char *)&rc, &rclen) < 0) || rc) {
Do we get in here and due to which of the three conditions?
 308             if (rc)
 309                 errno = rc;
 310             rc = -1;
 311         }
 312 #endif /* SO_ERROR */
 313     }
 314     /* Not sure we can be already connected */
 315     if (rc == -1 && errno == EISCONN)
 316         rc = 0;
Do we get up until here and what is the value of errno?
 317     soblock(sd);
What is the value of errno here?
 318     JK_TRACE_EXIT(l);
 319     return rc;

As an alternative: in 1.2.44 that part of the code was changed on platforms
that support poll, using poll instead of select there. 1.2.46 is not yet
released, but you can grab it for your tests from

https://dist.apache.org/repos/dist/dev/tomcat/tomcat-connectors/jk/

Regards,

Rainer

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to