Ticket #791 (closed defect: invalid )

Opened 5 years ago

Last modified 7 months ago

reapAllProcesses occassionally, as apparently signal delivery is unreliable

Reported by: itamarst Assigned to: glyph
Type: defect Priority: high
Milestone: Component: core
Keywords: Cc: itamarst, jknight, spiv, exarkun, glyph, jml
Branch: branches/sigchld-791-3 Author: glyph
Launchpad Bug:

Attachments

Change History

  2004-11-24 05:33:30+00:00 changed by jknight

Has this actually been verified to be true?

  2006-09-12 01:31:18+00:00 changed by glyph

  • component set to conch

It doesn't matter; see comments on #1997. We need to do this anyway.

  2006-09-12 01:49:21+00:00 changed by glyph

  • component changed from conch to core

  2006-09-15 19:46:35+00:00 changed by jknight

Implemented fix in source:branches/sigchld-791/

Technique: a C module which installs a signal handler for SIGCHLD, with SA_RESTART, and a C function to write to a given fd. The reactor listens on that fd, and calls reapAllProcesses when there's activity.

However, if the C module is not present, it instead starts a LoopingCall? running whenever there are processes waiting to be reaped, and doesn't install a SIGCHLD handler at all.

  2006-09-15 19:49:52+00:00 changed by jknight

  • cc changed from itamarst, jknight to itamarst, jknight, spiv, exarkun, glyph, jml

Also related to and should fix #1430 #1997

  2006-09-15 19:53:53+00:00 changed by jknight

And also #733

  2007-03-05 17:26:49+00:00 changed by therve

  • keywords set to review
  • owner deleted

It seems it would need review ?

  2007-03-05 18:26:34+00:00 changed by exarkun

  • keywords deleted

It doesn't have sufficient unit tests.

  2007-04-06 00:29:04+00:00 changed by mithrandi

  • owner set to jknight

  2007-04-06 00:53:32+00:00 changed by itamarst

The LoopingCall? should also be used if someone does reactor.run(installSignalHandlers=False), if it's not already. And probably should stop running if there's no Process instances and restart if necessary (so trial is happy), again, if it's not already got that behavior in the branch.

  2008-02-01 17:08:20+00:00 changed by exarkun

  • branch deleted
  • author deleted

In addition to #733 and #1997, see #2535.

  2008-04-01 13:36:32+00:00 changed by therve

  • branch set to branches/sigchld-791-2
  • author set to therve

(In [23160]) Branching to 'sigchld-791-2'

  2008-05-17 11:09:41+00:00 changed by therve

I had the opportunity to look at this a bit more. I think the looping call solution is wrong. Do we know exactly what platform doesn't have SA_RESTART? I think I'd prefer the current behavior with SIGCHLD than a polling system that browses every processes launched 10 times per second. This conflicts pretty badly with #2967.

  2008-05-27 20:35:46+00:00 changed by glyph

  • owner changed from jknight to glyph
  • status changed from new to assigned

  2008-05-27 21:25:08+00:00 changed by glyph

  • branch changed from branches/sigchld-791-2 to branches/sigchld-791-3
  • author changed from therve to glyph

(In [23726]) Branching to 'sigchld-791-3'

  2008-12-12 20:45:38+00:00 changed by exarkun

  • status changed from assigned to closed
  • resolution set to invalid
  • launchpad_bug deleted

SIGCHLD delivery is not unreliable. What is meant by "unreliable" when people talk about signal delivery is that multiple instances of a particular signal may be coalesced into one call to a signal handler in a process. So polling isn't necessary to deal with "unreliable signal delivery".

However, some of the code in this branch is still probably useful for resolving some Twisted process issues. For example, sigaction SA_RESTART prevents us from breaking os.popen. So some of this code should be used to resolve some tickets.

I'm closing this ticket because the problem it describes does not exist and the solution it suggests is therefore unnecessary. Since there is useful code in the branch, I will re-associate it with the ticket it's most directed at fixing, #733 (the branch conflicts with trunk, so it needed to be merged forward anyway).

Note: See TracTickets for help on using tickets.