state-threads
[Top] [All Lists]

Re: Proxy failure on ECONNABORTED

To: "Kiernan, Alex" <alexk@xxxxxxxxx>
Subject: Re: Proxy failure on ECONNABORTED
From: "Gene Shekhtman" <genes@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 13 Sep 2000 13:13:34 -0700
Cc: "'state-threads@xxxxxxxxxxx'" <state-threads@xxxxxxxxxxx>
In-reply-to: "Kiernan, Alex" <alexk@demon.net> "Proxy failure on ECONNABORTED" (Sep 13, 3:18pm)
References: <9B16CD9CFF9CD311B782009027D0D39301DB1CDB@gwhdemnts02.server.demon.net>
Sender: owner-state-threads@xxxxxxxxxxx
On Sep 13,  3:18pm, Kiernan, Alex wrote:
> Subject: Proxy failure on ECONNABORTED
> I was playing with the proxy example with state threads & managed to get one
> of the processes to die (dual CPU box). Whats happened was the accept() call
> returned with ECONNABORTED (this is on Solaris 7) which caused the caller to
> bug out.
>
> My immediate reaction was to change
>
>     if (errno == EINTR)
>
> to
>
>     if (errno == EINTR || errno == ECONNABORTED)
>
> in st_accept(), but I'm not convinced thats the right fix (OK it needs some
> ifdefing around it, but I was thinking more of where this is "the right
> fix").
>

I think that applications should deal with those types of errors and not the
library.  That is, you need to modify proxy.c (which is just an example)
to handle ECONNABORTED the way you want it.  Something along the lines:

....
    cli_nfd = st_accept(srv_nfd, (struct sockaddr *)&cli_addr, &n, -1);
    if (cli_nfd == NULL) {
      /* Ignore ECONNABORTED */
      if (errno == ECONNABORTED)
        continue;
      print_sys_error("st_accept");
      exit(1);
    }
....

In other words, treat st_accept() the same way as accept(3).

Gene

-- 
Gene Shekhtman                       genes@xxxxxxx
Internet Systems Engineering         650-933-8676
Silicon Graphics, Inc.


<Prev in Thread] Current Thread [Next in Thread>