Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block signals during RPM transaction processing #1984

Merged
merged 2 commits into from
Aug 31, 2023

Conversation

jan-kolarik
Copy link
Member

Prevent signals to interrupt the processing of the RPM transaction inside the DNF.

If the signal is received between the blockSignals calls, SQL DB is not properly closed then as this is normally handled later during the base cleanup. But the changes are present in the SQLite write-ahead log and when the DB is accessed next time, changes are propagated into the main file. We could move the unblocking statement further in the code, but I tried to keep the source code inside the blocking part in the minimum possible amount. The transaction summary logs still could be omitted, but maybe it is useful for debugging.

Note:
This was originally merged within the PR, but reverted soon as the provided API wasn't available on some RHEL and Fedora systems rebasing from upstream, which is not the case anymore.

Resolves https://issues.redhat.com/browse/RHEL-1235.

Prevent signals to interrupt the processing of the RPM transaction inside the DNF.

This was originally committed in db833ff, but reverted later in 969781d as the provided API wasn't available on some systems rebasing from upstream which is not the case anymore.

Resolves https://issues.redhat.com/browse/RHEL-1235.
@kontura
Copy link
Contributor

kontura commented Aug 29, 2023

I don't remember the details exactly but shouldn't we also increase the required rpm version to 4.18.0?
I think it will still cause the previous problem if someone tried to use it with older rpm.

@kontura kontura self-assigned this Aug 29, 2023
@jan-kolarik
Copy link
Member Author

jan-kolarik commented Aug 31, 2023

You're right. DNF wants to handle SIGPIPE by its overridden handler, but apparently before rpm 4.18.0 unblocking the signals via API caused process termination on SIGPIPE. Already discussed there. I will bump the rpm version.

We are using the `rpm.blockSignals()` around RPM transactions to prevent interrupting them from outside. With rpm < 4.18.0, unblocking signals via this API caused termination on `SIGPIPE` signal which is unwanted as we have an overridden handler for this signal in DNF. With rpm >= 4.18.0 this is not happening anymore, therefore bumping the version.
@kontura kontura merged commit 293eca5 into master Aug 31, 2023
3 checks passed
@kontura kontura deleted the jkolarik/transaction-block branch August 31, 2023 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants