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

[JENKINS-62655] IllegalStateException caused by misuse of Jenkins.instance from an agent JVM #308

Merged
merged 1 commit into from
Jun 11, 2020

Conversation

jglick
Copy link
Member

@jglick jglick commented Jun 10, 2020

Fixes a regression in #223. Untested; we need to add functional tests of app authentication with WireMock and agents.

Description

A brief summary describing the changes in this pull request. See
JENKINS-62655 for further information.

Submitter checklist

  • Link to JIRA ticket in description, if appropriate.
  • Change is code complete and matches issue description
  • Automated tests have been added to exercise the changes
  • Reviewer's manual test instructions provided in PR description. See Reviewer's first task below.

Reviewer checklist

  • Run the changes and verify that the change matches the issue description
  • Reviewed the code
  • Verified that the appropriate tests have been written or valid explanation given

Documentation changes

  • Link to jenkins.io PR, or an explanation for why no doc changes are needed

Users/aliases to notify

@jglick jglick requested a review from bitwiseman June 10, 2020 21:35
Jenkins jenkins = GitHubWebHook.getJenkinsInstance();

if (jenkins.proxy == null) {
Jenkins jenkins = Jenkins.getInstanceOrNull();
Copy link
Contributor

@bitwiseman bitwiseman Jun 10, 2020

Choose a reason for hiding this comment

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

@jglick
Is this needed given the JenkinsJVM.isJenkinsJVM() guard above?
Or perhaps we should pull the JenkinsJVM.isJenkinsJVM() check into this method?

Copy link
Member Author

Choose a reason for hiding this comment

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

Is this needed given the JenkinsJVM.isJenkinsJVM() guard above?

Preferably yes, in case this is called right during Jenkins shutdown, and it is hardly a critical function.

Or perhaps we should pull the JenkinsJVM.isJenkinsJVM() check into this method?

No, preferred to keep that in a separate place so that this method’s body is not even loaded from an agent JVM, lest that cause class linkage errors.

@bitwiseman
Copy link
Contributor

We need tests but we should not hold up this fix for them. We don't see any breakages, I'm taking this.

@bitwiseman bitwiseman merged commit b861024 into jenkinsci:master Jun 11, 2020
@jglick jglick deleted the ISE-JENKINS-62655 branch June 11, 2020 10:21
@jglick
Copy link
Member Author

jglick commented Jun 11, 2020

I presume you were unable to release this, in which case maybe 2.8.0 should be blacklisted in the UC?

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