| Store | Cart

Re: [Python-Dev] RFC: PEP 475, Retry system calls failing with EINTR

From: Matthew Woodcraft <matt...@woodcraft.me.uk>
Mon, 1 Sep 2014 21:17:33 +0000 (UTC)
Victor Stinner  <vict...@gmail.com> wrote:
> HTML version:> http://legacy.python.org/dev/peps/pep-0475/> PEP: 475> Title: Retry system calls failing with EINTR

I think the proposed design for how Python should behave is a good
one.

But I think this proposal needs to be treated in the same way as any
other backwards-incompatible change.


> Applications relying on the fact that system calls are interrupted> with ``InterruptedError`` will hang. The authors of this PEP don't> think that such application exist.

The authors are mistaken here. I have a program still running which was
designed around this behaviour.

My company won't be inconvenienced by this change because I can't
imagine the elderly program ever being ported to Python 3.

But I think it's very likely there are other such programs out there.


> If such applications exist, they are not portable and are subject to> race conditions (deadlock if the signal comes before the system call).

The program is certainly not portable (which is not any kind of a
problem), and as pselect is unavailable there is indeed the usual
theoretical race (which has not been a problem in practice in the ten
years it's been running).


(The program handles SIGTERM so that it can do a bit of cleanup before
exiting, and it uses the signal-handler-sets-a-flag technique. The call
that might be interrupted is sleep(), so the program doesn't strictly
_rely_ on the existing behaviour; it would just become very slow to
exit.)

-M-

_______________________________________________
Python-Dev mailing list
Pyth...@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: https://mail.python.org/mailman/options/python-dev/python-dev-ml%40activestate.com

Recent Messages in this Thread
Victor Stinner Aug 31, 2014 12:44 pm
Marko Rauhamaa Aug 31, 2014 03:19 pm
Victor Stinner Aug 31, 2014 08:59 pm
Marko Rauhamaa Aug 31, 2014 09:19 pm
Ethan Furman Aug 31, 2014 09:38 pm
Marko Rauhamaa Aug 31, 2014 10:15 pm
Antoine Pitrou Aug 31, 2014 10:37 pm
Victor Stinner Aug 31, 2014 10:45 pm
Greg Ewing Sep 01, 2014 07:15 am
Antoine Pitrou Sep 01, 2014 12:46 pm
Victor Stinner Aug 31, 2014 09:38 pm
Marko Rauhamaa Aug 31, 2014 10:04 pm
Victor Stinner Aug 31, 2014 10:36 pm
Greg Ewing Aug 31, 2014 10:28 pm
Dan Stromberg Sep 01, 2014 03:14 am
R. David Murray Sep 01, 2014 04:51 am
Marko Rauhamaa Sep 01, 2014 05:30 am
R. David Murray Sep 01, 2014 03:42 pm
Marko Rauhamaa Sep 01, 2014 03:59 pm
Victor Stinner Sep 01, 2014 07:27 am
Paul Moore Sep 01, 2014 06:12 am
Victor Stinner Sep 01, 2014 07:18 am
Marko Rauhamaa Sep 01, 2014 07:38 am
Charles-François Natali Sep 01, 2014 10:40 am
Marko Rauhamaa Sep 01, 2014 11:15 am
Charles-François Natali Sep 01, 2014 11:25 am
R. David Murray Sep 01, 2014 03:47 pm
Antoine Pitrou Sep 01, 2014 03:51 pm
Marko Rauhamaa Sep 01, 2014 04:00 pm
Antoine Pitrou Sep 01, 2014 12:58 pm
Matthew Woodcraft Sep 01, 2014 09:17 pm
Nick Coghlan Sep 02, 2014 12:23 pm
Matthew Woodcraft Sep 02, 2014 09:02 pm
Victor Stinner Sep 02, 2014 09:35 pm
Antoine Pitrou Sep 02, 2014 02:48 pm
Matthew Woodcraft Sep 02, 2014 09:03 pm
Victor Stinner Sep 02, 2014 09:40 pm
Matthew Woodcraft Sep 03, 2014 08:26 pm
Messages in this thread