9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Charles Forsyth <charles.forsyth@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] file descriptor leak
Date: Tue, 16 Feb 2016 21:16:27 +0000	[thread overview]
Message-ID: <CAOw7k5jCGQCcivH6nonTC=u8FpN0XQ4YQOerM1TXQTFjogW_Zg@mail.gmail.com> (raw)
In-Reply-To: <21e3f8eee50170d6fcd21c43384eba04@felloff.net>

[-- Attachment #1: Type: text/plain, Size: 1164 bytes --]

On 16 February 2016 at 18:01, <cinap_lenrek@felloff.net> wrote:

> and the parent proc doesnt need the fd to /dev/null, it could as well just
> open it in the child like:
>
> close(0); open("/dev/null", OREAD);
>
>
There's no harm in making and using a more general function, even in a
specific way, so that part's ok.
The caller just needs to play its part properly.

after spending 5 minutes writing the code fixing all these issues mentiond
> above, i'll just throw it all away and delete the whole remounting logic
> for /net.alt in 9front.


It's often better to use the Erlang fail-fast ("just fail") and restart
approach for persistent services.

More important would be to look at /proc/N/fd on a failing system.
I've a feeling that the system/outside stuff isn't actually the problem,
since I've seen the diagnostic on a system that wasn't using /net.alt.
In that case, the problem (as I remember it) was that an Internet link
further on was down,
so no messages got through to remote DNS, and file descriptors were
building up in slave processes
waiting for replies on /net/udp. Once the link was up, it went back to
normal.

[-- Attachment #2: Type: text/html, Size: 2339 bytes --]

  parent reply	other threads:[~2016-02-16 21:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-16 15:52 arisawa
2016-02-16 15:56 ` Jacob Todd
2016-02-16 16:42   ` lucio
2016-02-16 17:05     ` Jacob Todd
2016-02-16 17:17     ` Charles Forsyth
2016-02-16 18:01 ` cinap_lenrek
2016-02-16 21:05   ` erik quanstrom
2016-02-16 21:16   ` Charles Forsyth [this message]
2016-02-17  2:19     ` cinap_lenrek
2016-02-22  5:18     ` erik quanstrom
2016-02-16 22:24 ` Charles Forsyth
2016-02-17  1:13   ` arisawa
2016-02-17  1:22     ` cinap_lenrek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAOw7k5jCGQCcivH6nonTC=u8FpN0XQ4YQOerM1TXQTFjogW_Zg@mail.gmail.com' \
    --to=charles.forsyth@gmail.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).