Hi!
----
If the assumption below is correct (that an application has to handle
both EPIPE and ECONRESET the same way) then some code in ksh93, libast
and some utilties need to be updated. For example this fragment in
io.c ...
-- snip --
else if(mode==SF_WRITE && errno==EPIPE)
{
sfpurge(iop);
return(-1);
}
-- snip --
... needs to be changed to:
-- snip --
else if(mode==SF_WRITE && ((errno==EPIPE) || (errno==ECONNRESET)))
{
sfpurge(iop);
return(-1);
}
-- snip --
IMO a macro which tests for both EPIPE and ECONNRESET in an libast
header would be usefull... example:
-- snip --
#define EPIPE_GONE(errn) (((errn)==EPIPE) || ((errn)==ECONNRESET))
-- snip --
----
Bye,
Roland
---------- Forwarded message ----------
From: Lionel Cons <[email protected]>
Date: Thu, May 31, 2012 at 10:59 PM
Subject: Re: [ast-users] ksh: command pipe -- connection reset
To: "Nemeth, Michael Kenneth (Mike)" <[email protected]>
Cc: "[email protected]" <[email protected]>
On 31 May 2012 22:48, Lionel Cons <[email protected]> wrote:
> On 31 May 2012 22:38, Lionel Cons <[email protected]> wrote:
>> On 31 May 2012 21:48, Nemeth, Michael Kenneth (Mike)
>> <[email protected]> wrote:
>>>
>>> Hello,
>>>
>>>
>>>
>>> We are using ksh93u (2011-02-08) source compiled on rhel5.0 and we are
>>> experiencing intermittent connect reset errors with typical unix command
>>> pipelines.
>>>
>>>
>>>
>>> Example:
>>>
>>>
>>>
>>> min=`grep -v "^#" $infile | head -1 | nawk '{printf("%.3f\n",$3)}'`
>>>
>>>
>>>
>>> will produce error:
>>>
>>>
>>>
>>> grep: writing output: Connection reset by peer
>>>
>>>
>>>
>>> I reviewed all ast-user, ast-developers archives, and other forums I have
>>> come to the following topics:
>>>
>>>
>>>
>>> bug#9089: [1003.1(2008)/Issue 7 0000205]: Shell pipeline connection
>>> requirement too vague
>>>
>>>
>>>
>>> http://lists.gnu.org/archive/html/bug-coreutils/2011-07/msg00090.html
>>>
>>> http://lists.gnu.org/archive/html/bug-coreutils/2011-07/msg00089.html
>>>
>>>
>>>
>>> Is there a solution to this issue?
>>
>> Yes, get the Linux kernel to support I_PEEK on pipes and fifos like
>> Solaris does. AFAIK sockets are used because pipes on Linux do not
>> support I_PEEK, and without I_PEEK the shell would have to read the
>> streams byte by byte, i.e. one syscall per byte. Solaris allows I_PEEK
>> on pipes, fifos and sockets and gets a huge performance benefit from
>> that.
>
> It seems SIGPIPE is send for ECONNRESET, too. My guess is to file a
> bug against the application in question to handle ECONNRESET like
> EPIPE.
> This is what most applications do in this case, we've encountered the
> issue before with grid-enabled shells which pass parts of a shell pipe
> chain to other machines through SCTP.
The second reason why this is the application's (and not ksh's) fault
is that the destination can be a real network socket anyway (which is
allowed by the standard and logic); not handling this correctly is a
bug in the application.
Lionel
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users
--
__ . . __
(o.\ \/ /.o) [email protected]
\__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer
/O /==\ O\ TEL +49 641 3992797
(;O/ \/ \O;)
_______________________________________________
ast-developers mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-developers