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 Josef Havránek
Recipients Josef Havránek
Date 2020-06-26.17:34:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1593192889.65.0.44895771655.issue41128@roundup.psfhosted.org>
In-reply-to
Content
python3 When handling signals (via signal module) have delayed execution when main thread is blocked/waiting for event

That is sub-optimal(signal "could get lost"). Signals shoud be handled asap... Think about scenario when os may be asking python nicely before it sends os.kill...so we could be dead on next bytecode instruction of main thread.

In such scenario when main thread is blocked and VM recives signal it should "context switch" to handler immediately thus not being dependent on state of main thread to be in executable state.

This gotcha should be included in documentation of all 3.x version since there should be nothing running(including long-runing c computation like regex matching ;) ) and basicly nothing is preventing handler from execution 

more details and test script in file attached

ps excuse my english/typos and uglines of code... this is my 1st bug report/enhancment proposal
History
Date User Action Args
2020-06-26 17:34:49Josef Havráneksetrecipients: + Josef Havránek
2020-06-26 17:34:49Josef Havráneksetmessageid: <1593192889.65.0.44895771655.issue41128@roundup.psfhosted.org>
2020-06-26 17:34:49Josef Havráneklinkissue41128 messages
2020-06-26 17:34:49Josef Havránekcreate