Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(947)

Issue 16700044: Isolate the SIGCHLD handler from the unix event loop (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 6 months ago by ayba
Modified:
10 years, 6 months ago
Reviewers:
sbt, GvR
Visibility:
Public.

Description

The purpose is twofold: 1. clarify the interface between different event loops (there can be only one SIGCHLD handler) 2. allow reimplementing the sigchld handler using a different strategy (waitpid(-1), polling, blocking waitpid in a separate thread, ...) I included two implementations: one which calls waitpid(-1) and one which avoids it. Point 1. is needed to allow multiple event loop implementations to interoperate within the same process. I wrote an implementation for the GLib event loop too: https://bitbucket.org/a_ba/gbulb/commits/2f409adad942107afb7bc96994235e30caa4c17c

Patch Set 1 #

Patch Set 2 : second try #

Patch Set 3 : new unit tests + bugfix #

Total comments: 1

Patch Set 4 : merged upstream changes #

Patch Set 5 : child watcher managed by the event loop policy #

Patch Set 6 : DefaultEventLoopPolicy split in two classes #

Patch Set 7 : FastChildWatcher refactored + race condition + unit tests #

Total comments: 21

Patch Set 8 : nitpicks + race condition #

Total comments: 7

Patch Set 9 : second nitpicks burst #

Patch Set 10 : remove all signal handlers on .close() #

Unified diffs Side-by-side diffs Delta from patch set Stats (+21 lines, -0 lines) Patch
M asyncio/unix_events.py View 1 2 3 4 5 6 7 8 9 1 chunk +5 lines, -0 lines 0 comments Download
M tests/test_unix_events.py View 1 2 3 4 5 6 7 8 9 1 chunk +16 lines, -0 lines 0 comments Download

Messages

Total messages: 19
GvR
I finally got to review this (sorry, it's been a busy week with other Tulip ...
10 years, 6 months ago (2013-10-31 23:10:51 UTC) #1
ayba
On 2013/10/31 23:10:51, GvR wrote: > I finally got to review this (sorry, it's been ...
10 years, 6 months ago (2013-11-01 11:50:36 UTC) #2
ayba
did some refactoring The main change is the introduction of the .set_loop() method in the ...
10 years, 6 months ago (2013-11-01 19:05:08 UTC) #3
GvR
Are you done checking in new versions? :-) I like almost everything about this version! ...
10 years, 6 months ago (2013-11-01 19:05:22 UTC) #4
ayba
On 2013/11/01 19:05:22, GvR wrote: > Are you done checking in new versions? :-) > ...
10 years, 6 months ago (2013-11-01 19:27:30 UTC) #5
GvR
On 2013/11/01 19:27:30, ayba wrote: > On 2013/11/01 19:05:22, GvR wrote: > > Are you ...
10 years, 6 months ago (2013-11-01 20:38:32 UTC) #6
GvR
I'm slightly confused: watchers are context managers already, but it looks like they don't do ...
10 years, 6 months ago (2013-11-01 20:55:52 UTC) #7
ayba
> > > Are you done checking in new versions? :-) I hope I'm finished ...
10 years, 6 months ago (2013-11-02 14:49:35 UTC) #8
GvR
Thanks for being so thorough! Here are a whole bunch of silly nits about docstring ...
10 years, 6 months ago (2013-11-03 22:02:14 UTC) #9
ayba
On 2013/11/03 22:02:14, GvR wrote: > https://codereview.appspot.com/16700044/diff/120001/asyncio/unix_events.py#newcode527 > asyncio/unix_events.py:527: else (expected_pid,)): > This expression looks ...
10 years, 6 months ago (2013-11-04 12:26:29 UTC) #10
GvR
https://codereview.appspot.com/16700044/diff/140001/asyncio/locks.py File asyncio/locks.py (right): https://codereview.appspot.com/16700044/diff/140001/asyncio/locks.py#newcode158 asyncio/locks.py:158: # TODO: add waiters:N if > 0. Whoops, looks ...
10 years, 6 months ago (2013-11-04 18:22:32 UTC) #11
ayba
On 2013/11/04 18:22:32, GvR wrote: > https://codereview.appspot.com/16700044/diff/140001/asyncio/locks.py#newcode158 > asyncio/locks.py:158: # TODO: add waiters:N if > ...
10 years, 6 months ago (2013-11-04 23:05:01 UTC) #12
GvR
On 2013/11/04 23:05:01, ayba wrote: > On 2013/11/04 18:22:32, GvR wrote: > > > https://codereview.appspot.com/16700044/diff/140001/asyncio/locks.py#newcode158 ...
10 years, 6 months ago (2013-11-04 23:30:35 UTC) #13
sbt
There are failures on the buildbots because the SIGCHLD handler is not being removed and ...
10 years, 6 months ago (2013-11-06 16:13:20 UTC) #14
GvR
On 2013/11/06 16:13:20, sbt wrote: > There are failures on the buildbots because the SIGCHLD ...
10 years, 6 months ago (2013-11-06 16:17:45 UTC) #15
sbt
> Whoops. I don't have time to debug right now. Should I roll back the ...
10 years, 6 months ago (2013-11-06 16:43:27 UTC) #16
ayba
Hi, the unix loop .close() method was actually removed by the patch (SIGCHLD registration is ...
10 years, 6 months ago (2013-11-06 18:16:11 UTC) #17
GvR
On 2013/11/06 18:16:11, ayba wrote: > Hi, > the unix loop .close() method was actually ...
10 years, 6 months ago (2013-11-07 04:28:34 UTC) #18
ayba
10 years, 6 months ago (2013-11-07 06:53:31 UTC) #19
On 07/11/2013 05:28, gvanrossum@gmail.com wrote:
> In fact .close() should clean all signal handlers, not only SIGCHLD. I
> am
>> sending a new patch to fix this.
>
> Thanks for the quick fix. Applied and pushed. Can you watch the
> buildbots?
they look all green

> PS. Since this was already committed it would have been easier (for me)
> if you had created a new issue with just the new patch. In fact I didn't
> notice the new version on this issue until 15 minutes ago. :-)
ok, next time I will know ;)

Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b