Skip to content

[JENKINS-75512] Ensure SIGPIPE is not hidden when calling shell script to avoid hanging. #253

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Romain-Geissler-1A
Copy link

@Romain-Geissler-1A Romain-Geissler-1A commented Apr 6, 2025

This change aims at fixing the hanging issue we hit when using a JDK 21 agent image to run Jenkins and some sh command that require SIGPIPE to work fine in order to finish. See the example of such a command in the ticket JENKINS-75512 (https://issues.jenkins.io/browse/JENKINS-75512) as well as explanations.

Here we wrap the call to nohup by a call to env --default-signal=SIGPIPE to avoid this issue. Since not all Linux distro will support env --default-signal=SIGPIPE (this flag was introduced in 2019 in coreutils), wrap this in some more complex shell command to be able to fallback to not using env at all if the OS doesn't support it.

Testing done

The details of the testing done is in the ticket JENKINS-75512 (https://issues.jenkins.io/browse/JENKINS-75512) (checked via commands run inside a fedora container).

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • [N/A] Link to relevant pull requests, esp. upstream and downstream changes
  • [N/A] Ensure you have provided tests - that demonstrates feature works or fixes the issue

@Romain-Geissler-1A Romain-Geissler-1A requested a review from a team as a code owner April 6, 2025 23:16
@Romain-Geissler-1A Romain-Geissler-1A force-pushed the bugfix/avoid-sigpipe-hanging branch from f12f81c to bb9c965 Compare April 6, 2025 23:20
@jglick
Copy link
Member

jglick commented Apr 10, 2025

As a rule, we prefer not to add complications to the wrapper shell script. Does the binary wrapper handle this situation better? If not, could it be patched to do so?

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.

2 participants