AnyEvent::Fork::RPC broken pipe

Marc Lehmann schmorp at schmorp.de
Tue Jun 24 14:08:08 CEST 2014


On Fri, Jun 20, 2014 at 09:56:40AM +0200, Art Sackett <asackett at gmx.com> wrote:
>      2014-06-20 00:46:51.641738 -0600 fatal AnyEvent::Fork::RPC::Async:
>    AnyEvent::Fork::RPC: write error (Broken pipe), parent gone?

In general, this means that the program exited without destroying the RPC
subprocess (and waiting for it to be destroyed).

>    I modified the module to echo the string contained in $wbuf in the AE::log
>    statement and it comes up empty (null string). I'm not expecting any data
>    at the program exit point, as it doesn't come until after all of the
>    callbacks have been invoked. Does this "fatal" indicate that I've done
>    something wrong? If so what might I look for, and if not, how do I
>    suppress that message so I don't look any dumber than I am?

I think you are probably hitting a corner case in the async backend, which is
too overzealous to report an error: On the one hand, it is unexpected that
the connection closes "hard", on the other hand, if there are no outstanding
requests, one could argue that the subprocess should just exit quietly.

If you have a small test program that encounters this situation, I could use
it to check what really is going on and think about a more graceful solution.
If you don't, that's fine, too, I'll just look at the backend again and hope
I see something obvious.

For starters, look at AnyEvent:Fork::RPC::Async, and a bit after the line
with "microshit windoze" in it, change this:

   $ww ||= AE::io $wfh, 1, $wcb;

into this:

   goto &$done unless $busy;

This is probably not a robust workaorund, but if that makes the error go
away, I have an idea what causes it.

-- 
                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_              http://www.deliantra.net
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      schmorp at schmorp.de
      -=====/_/_//_/\_,_/ /_/\_\



More information about the anyevent mailing list