This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Andre Merzky
Recipients Andre Merzky, eryksun, gslavin
Date 2016-09-13.07:44:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1473752688.04.0.252998082547.issue27889@psf.upfronthosting.co.za>
In-reply-to
Content
FWIW, a workaround seems to be a nested try/except clause:

try:
  try:
    do_lots_of_work()
  except RuntimeError as e:
    print 'signal handling worked'
except RuntimeError:
  print 'signal handling delayed'

I did a stress test over 100k runs, and got no unexpected behavior that way.  I am not sure if the underlying race condition is just hidden, or if the inner except clause triggers the signal handling code internally -- either way, while cumbersome to use, it seems to work.

I'd still appreciate feedback on a cleaner solution.

Thanks, Andre.
History
Date User Action Args
2016-09-13 07:44:48Andre Merzkysetrecipients: + Andre Merzky, eryksun, gslavin
2016-09-13 07:44:48Andre Merzkysetmessageid: <1473752688.04.0.252998082547.issue27889@psf.upfronthosting.co.za>
2016-09-13 07:44:48Andre Merzkylinkissue27889 messages
2016-09-13 07:44:47Andre Merzkycreate