tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Barker" <wbar...@wilshire.com>
Subject Re: jk_connect and multi-threading
Date Mon, 12 Jul 2004 18:18:53 GMT

----- Original Message -----
From: "Henri Gomez" <hgomez@apache.org>
To: "Tomcat Developers List" <tomcat-dev@jakarta.apache.org>
Sent: Monday, July 12, 2004 3:07 AM
Subject: jk_connect and multi-threading


> Hi to all,
>
> I'm looking for a strange problem under iSeries (AS/400) and wonder
> about this look in jk_open_socket() (jk_connect.c) :
>
>          do {
>              jk_log(l, JK_LOG_DEBUG, "jk_open_socket, try to connect
> socket = %d to %s\n",
>                     sock, jk_dump_hinfo(addr, buf));
>
>              ret = connect(sock,
>                            (struct sockaddr *)addr,
>                            sizeof(struct sockaddr_in));
> #if defined(WIN32) || (defined(NETWARE) && defined(__NOVELL_LIBC__))
>              if(SOCKET_ERROR == ret) {
>                  errno = WSAGetLastError() - WSABASEERR;
>              }
> #endif /* WIN32 */
>              jk_log(l, JK_LOG_DEBUG, "jk_open_socket, after connect ret
> = %d\n", ret);
>          } while (-1 == ret && EINTR == errno);
>
>
> What's the status on errno in multi-threaded environnement ?
>

On older *nix boxes it wasn't safe to use it with threads.  Don't know about
iSeries.  On Solaris it's per-thread (assuming that you've compiled
with -D_REENTRANT).

> Shouldn't we clear errno before the connect() call ?
>

It's not supposed to matter.

> BTW, I wonder why we check the errno in such case...
>
>
> I see many errors in Apache 2.0.48 on my iSeries when I try to connect
> to some workers (more than 40 defined) and it seems that some of them
> couldn't be reached :
>
> [Thu Jul 08 17:13:22 2004]  [jk_ajp_common.c (720)]: Error connecting to
> tomcat. Tomcat is probably not started or is listening o
> n the wrong host/port (127.0.0.1:11013). Failed errno = 3021
>
> [Thu Jul 08 17:13:22 2004]  [jk_ajp_common.c (1024)]: Error connecting
> to the Tomcat process.
> [Thu Jul 08 17:13:22 2004]  [jk_ajp_common.c (1468)]: sending request to
> tomcat failed in send loop. err=0
> [Thu Jul 08 17:13:22 2004]  [jk_connect.c (181)]: jk_open_socket,
> connect() failed errno = 3021
> [Thu Jul 08 17:13:22 2004]  [jk_ajp_common.c (720)]: Error connecting to
> tomcat. Tomcat is probably not started or is listening o
> n the wrong host/port (127.0.0.1:11013). Failed errno = 3021
>
> [Thu Jul 08 17:13:22 2004]  [jk_ajp_common.c (1024)]: Error connecting
> to the Tomcat process.
> [Thu Jul 08 17:13:22 2004]  [jk_ajp_common.c (1468)]: sending request to
> tomcat failed in send loop. err=1
> [Thu Jul 08 17:13:22 2004]  [jk_connect.c (181)]: jk_open_socket,
> connect() failed errno = 3021
> [Thu Jul 08 17:13:22 2004]  [jk_ajp_common.c (720)]: Error connecting to
> tomcat. Tomcat is probably not started or is listening o
> n the wrong host/port (127.0.0.1:11013). Failed errno = 3021
>
> [Thu Jul 08 17:13:22 2004]  [jk_ajp_common.c (1024)]: Error connecting
> to the Tomcat process.
> [Thu Jul 08 17:13:22 2004]  [jk_ajp_common.c (1468)]: sending request to
> tomcat failed in send loop. err=2
> [Thu Jul 08 17:13:22 2004]  [jk_ajp_common.c (1477)]: Error connecting
> to tomcat. Tomcat is probably not started or is listening
> on the wrong port. worker=mysys-xxx-101 failed errno = 3021
>
>
>
> What is strange is that there is a tomcat running at port 11013 and
> I could reach it from another Apache 2 box.
>
> The 3021 errcode is an iSeries error code which seems indicate something
> not related with IP problems.
>
> Advices, intutions, magic more than welcome.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>


Mime
View raw message