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

Add experiment to avoid a recursive trap #2209

Merged
merged 4 commits into from
Jul 17, 2023

Conversation

triarius
Copy link
Contributor

@triarius triarius commented Jul 17, 2023

Some jobs are run as a bash script of the form:

trap "kill -- $$" INT TERM QUIT; <command>

We now understand this causes a bug (see the code comments), and we want to avoid it.

This PR adds an experiment to avoid adding the trap to the script.

@triarius triarius force-pushed the pdp-1326-implement-experiment-to-avoid-recursive-trap branch from 9cbdd8f to 5ba40b9 Compare July 17, 2023 05:45
@triarius triarius marked this pull request as ready for review July 17, 2023 05:45
@triarius triarius requested a review from a team July 17, 2023 05:45
@@ -1966,10 +1976,19 @@ func (e *Executor) defaultCommandPhase(ctx context.Context) error {
return err
}

// Update: The comment below is of dubious validity, because:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be better to incorporate or replace the dubious comment...

// The below is the "recursive trap". 
// The original idea was to ...
// But ..., so we are phasing it out under an experiment.

// to show the error to users.
e.shell.Errorf("The command was interrupted by a signal: %v", commandErr)

// although error is an exit error, it's not returned. (seems like a bug)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(seems like a bug) seems like a bug.

Copy link
Contributor

@DrJosh9000 DrJosh9000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ship it ✅

@triarius triarius merged commit a4ee642 into main Jul 17, 2023
1 check passed
@triarius triarius deleted the pdp-1326-implement-experiment-to-avoid-recursive-trap branch July 17, 2023 10:48
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