----- Original Message -----
From: "Henri Gomez" <[EMAIL PROTECTED]>
To: "Tomcat Developers List" <[EMAIL PROTECTED]>
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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>

This message is intended only for the use of the person(s) listed above as the 
intended recipient(s), and may contain information that is PRIVILEGED and 
CONFIDENTIAL.  If you are not an intended recipient, you may not read, copy, or 
distribute this message or any attachment. If you received this communication in 
error, please notify us immediately by e-mail and then delete all copies of this 
message and any attachments.

In addition you should be aware that ordinary (unencrypted) e-mail sent through the 
Internet is not secure. Do not send confidential or sensitive information, such as 
social security numbers, account numbers, personal identification numbers and 
passwords, to us via ordinary (unencrypted) e-mail.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to