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

Improve the case where the Jenkins process stopped unexpectedly #613

Merged
merged 1 commit into from
Jun 23, 2023

Conversation

Vlatombe
Copy link
Member

@Vlatombe Vlatombe commented Jun 22, 2023

It was printing a stacktrace with Connection refused (Connection refused)

This now prints the exit code.

Testing done

Submitter checklist

Edit tasklist title
Beta Give feedback Tasklist Submitter checklist, more options

Delete tasklist

Delete tasklist block?
Are you sure? All relationships in this tasklist will be removed.
  1. Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
    Options
  2. Ensure that the pull request title represents the desired changelog entry
    Options
  3. Please describe what you did
    Options
  4. Link to relevant issues in GitHub or Jira
    Options
  5. Link to relevant pull requests, esp. upstream and downstream changes
    Options
  6. Ensure you have provided tests - that demonstrates feature works or fixes the issue
    Options

It was printing a stacktrace with Connection refused (Connection refused)

This now prints the exit code.
@Vlatombe Vlatombe requested a review from jglick June 22, 2023 07:26
@Vlatombe Vlatombe added the bug label Jun 22, 2023
@Vlatombe Vlatombe merged commit 7dd434e into jenkinsci:master Jun 23, 2023
13 checks passed
@Vlatombe Vlatombe deleted the exception-on-stop branch June 23, 2023 13:40
try {
endpoint("exit").openStream().close();
} catch (ConnectException e) {
System.err.println("Unable to connect to the Jenkins process to stop it.");
Copy link
Member

Choose a reason for hiding this comment

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

I guess a stack trace is uninteresting here?

Copy link
Member Author

Choose a reason for hiding this comment

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

We'll get a stacktrace from the assertion error just below if it happens.

Copy link
Member

Choose a reason for hiding this comment

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

I meant the stack trace from the ConnectException. Really only the detail message could possibly be interesting.

@Test public void killedExternally() throws Throwable {
rr.startJenkins();
try {
rr.proc.destroy();
Copy link
Member

Choose a reason for hiding this comment

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

Or I suppose it would work to runRemotely something that asynchronously calls Jenkins.exit?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, though exit code wouldn't be the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants