From: Jason Stubbs <jstubbs@gentoo.org>
To: gentoo-portage-dev@lists.gentoo.org
Subject: Re: [gentoo-portage-dev] [5/7] portage_exec cleanups
Date: Sun, 30 Oct 2005 02:28:27 +0900 [thread overview]
Message-ID: <200510300228.27670.jstubbs@gentoo.org> (raw)
In-Reply-To: <20051029171753.GP24883@nightcrawler>
On Sunday 30 October 2005 02:17, Brian Harring wrote:
> On Sun, Oct 30, 2005 at 01:40:41AM +0900, Jason Stubbs wrote:
> > Even with the fd_pipes, the try/except block in there covers a bug that
> > is hit every time it is entered.
>
> *cough* really doesn't surprise me. :)
>
> > > Looking through the 2.4 subprocess module (which came along after the
> > > mods in question), adding an option controlling the fd cleansing would
> > > make sense, as long as the default option is to close the fds.
> >
> > Given the threading comment, I'd be agreeable to this. However, the spawn
> > of tee would have to specifically close the write side of the pipe when
> > unknown FDs aren't closed. Is having two extra paramaters, close_fds (a
> > list) and close_all_fds (a bool), to spawn okay?
>
> It's needed for any logged calls, doesn't mean I like it though. How
> about this,
> def spawn(...close_fds=True...):
> if close_fds is True:
> # kill all that aren't marked for open
> elif close_fds:
> # must be an iterable of what to kill
> else:
> #whatever code required to keep it from nuking file handles
>
> Don't really like that one much myself, but it would allow for the
> logging to use the existing structure, and one less option on the
> overgrown spawn* prototype(s).
Yep, this sort of messyness is why I chose to back down. ;)
> sidenote, since max_fd_limit needs to survive, tag
> try:
> import resource
> - max_fd_limit=resource.getrlimit(RLIMIT_NOFILE)
> + max_fd_limit=resource.getrlimit(resource.RLIMIT_NOFILE)
> except SystemExit, e:
> raise
>
> in while you're at it, since that's obviously broke. Current code
> would default to range(256), but default is 1024 fds for gentoo boxes
> (so that _is_ a hole).
Got that one already, but I didn't want to point out too many bugs. ;)
(There's still one more you missed there, btw; getrlimit() returns a tuple)
--
Jason Stubbs
--
gentoo-portage-dev@gentoo.org mailing list
next prev parent reply other threads:[~2005-10-29 17:28 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-23 6:45 [gentoo-portage-dev] [Bug 104705] emerge doesn't print complete error message Jason Stubbs
2005-10-29 10:34 ` [gentoo-portage-dev] [0/7] portage_exec cleanups (WAS: [Bug 104705] emerge doesn't print complete error message) Jason Stubbs
2005-10-29 10:41 ` [gentoo-portage-dev] [1/7] portage_exec cleanups Jason Stubbs
2005-10-29 10:44 ` [gentoo-portage-dev] [2/7] " Jason Stubbs
2005-10-29 10:49 ` [gentoo-portage-dev] [3/7] " Jason Stubbs
2005-10-29 14:22 ` Brian Harring
2005-10-29 15:06 ` Jason Stubbs
2005-10-29 15:17 ` Brian Harring
2005-10-29 10:52 ` [gentoo-portage-dev] [4/7] " Jason Stubbs
2005-10-29 11:03 ` Jason Stubbs
2005-10-29 10:56 ` [gentoo-portage-dev] [5/7] " Jason Stubbs
2005-10-29 15:25 ` Jason Stubbs
2005-10-29 16:04 ` Brian Harring
2005-10-29 16:40 ` Jason Stubbs
2005-10-29 17:17 ` Jason Stubbs
2005-10-29 17:17 ` Brian Harring
2005-10-29 17:28 ` Jason Stubbs [this message]
2005-10-29 17:20 ` Jason Stubbs
2005-10-29 17:28 ` Brian Harring
2005-10-29 10:57 ` [gentoo-portage-dev] [6/7] " Jason Stubbs
2005-10-29 11:01 ` [gentoo-portage-dev] [7/7] " Jason Stubbs
2005-10-29 17:32 ` [gentoo-portage-dev] [0/7] portage_exec cleanups (WAS: [Bug 104705] emerge doesn't print complete error message) Jason Stubbs
2005-10-29 17:38 ` Jason Stubbs
2005-10-30 7:03 ` Jason Stubbs
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=200510300228.27670.jstubbs@gentoo.org \
--to=jstubbs@gentoo.org \
--cc=gentoo-portage-dev@lists.gentoo.org \
/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