Bug 707382

Summary: RFE: Make it possible to interrupt on signals
Product: [Fedora] Fedora Reporter: Miloslav Trmač <mitr>
Component: python-nssAssignee: Nathan Kinder <nkinder>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhide   
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-08-02 15:31:28 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Miloslav Trmač 2011-05-24 21:19:49 UTC
Version-Release number of selected component (if applicable):
python-nss-0.11-2.fc16.src.rpm
nspr-4.8.8-1.fc16.src.rpm

It is currently impossible to terminate a program blocked in python-nss by a signal and do a proper cleanups.


From the NSPR side, NSPR internally loops on -EINTR, ignoring the signal completely (assuming that the handler will do something), only checking the PR_Interrupt() flag on each -EINTR.

From the Python side, Python's signal handler only marks the signal as pending and does not run any Python code.

So, when a signal comes, the Python handler executes but does not affect the NSPR state, and NSPR just enters another iteration of the loop.


One possible solution would be to use Python's signal.set_wakeup_fd() (causing Python to write a byte to a specified pipe) and start a thread that only waits until data is available in that pipe and then sends PR_Interrupt() to the other threads, breaking the NSPR loop and allowing Python to handle the signal.

This would require exposing NSPR's PR_GetCurrentThread() and PR_Interrupt() through python-nss.  Do you think this makes sense?

Comment 2 Miro Hrončok 2021-08-02 15:31:28 UTC
Automation has figured out the package is retired in rawhide.

If you like it to be unretired, please open a ticket at https://pagure.io/releng/new_issue?template=package_unretirement