Skip to content

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