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

Fix regression in Lua scriptlet runaway child detection #2818

Merged
merged 1 commit into from Dec 15, 2023

Conversation

pmatilai
Copy link
Member

@pmatilai pmatilai commented Dec 15, 2023

Fix regression in Lua scriptlet runaway child detection

Commit a810765 moved the detection to parent using waitpid(), but this causes it to complain on any process in the same process group. In the usual rpm context we don't have any, but we can't very well tell API users not to have any children. And then failed to detect a runaway Lua child in one of our own tests. Uff.

rpmlog() in the child has the issues mentioned in the originating commit, but that's a problem that needs to be solved elsewhere. Revert back to issuing a warning when we actually are in the child process, so there are no false positive possible. Use EXIT_FAILURE like in the original version, dunno why I'd changed that.

Update the rpmlua test to expect the deserved warning, and use stdio for printing its "normal" output, the catch there is that we need to flush the io in the child.

Reported at https://bugzilla.redhat.com/show_bug.cgi?id=2254463

@pmatilai pmatilai added REGRESSION lua Lua bindings/interface labels Dec 15, 2023
@pmatilai pmatilai changed the title Fix false positives from Lua scriptlet runaway child detection Fix regression in Lua scriptlet runaway child detection Dec 15, 2023
Commit a810765 moved the detection
to parent using waitpid(), but this causes it to complain on any
process in the same process group. In the usual rpm context we don't
have any, but we can't very well tell API users not to have any
children. And then failed to detect a runaway Lua child in one of
our own tests. Uff.

rpmlog() in the child has the issues mentioned in the originating
commit, but that's a problem that needs to be solved elsewhere.
Revert back to issuing a warning when we actually *are* in the child
process, so there are no false positive possible. Use EXIT_FAILURE
like in the original version, dunno why I'd changed that.

Update the rpmlua test to expect the deserved warning, and use
stdio for printing its "normal" output, the catch there is that we
need to flush the io in the child.

Reported at https://bugzilla.redhat.com/show_bug.cgi?id=2254463
@pmatilai pmatilai merged commit bb4aaaa into rpm-software-management:master Dec 15, 2023
1 check passed
@pmatilai pmatilai deleted the runaway branch December 15, 2023 12:19
@dmnks dmnks added bug and removed bug labels Feb 5, 2024
@dmnks dmnks mentioned this pull request Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lua Lua bindings/interface REGRESSION
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants