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

Decline to cache a likely incorrect computation #7485

Merged
merged 1 commit into from
Dec 8, 2022

Conversation

basil
Copy link
Member

@basil basil commented Dec 7, 2022

Based on my analysis in JENKINS-70206, Jenkins#getAgentProtocols is caching a bad value early in the initialization process due to a new race condition introduced by the split of instance-identity to a plugin, even though a correct value could be computed when it is needed later during the test. If this theory is correct, a simple workaround would be to decline to cache the likely incorrect computation, forcing recomputation later when a correct value is computable. Of course a long-term solution would look more like this or explicitly defining the order of initialization within Guice (for example with a constructor parameter), but this should at least stabilize the test suite on Windows in the meantime.

Testing done

I've gotten 4 consecutive succesful runs of jenkins.security.Security218Test with this PR, which is more than I could get yesterday without this PR. Checking in this change can't hurt, but I'll keep running the build another 2-3 or times and close this PR if a failure of jenkins.security.Security218Test demonstrates this PR to be ineffective.

Proposed changelog entries

N/A

Proposed upgrade guidelines

N/A

Submitter checklist

  • The Jira issue, if it exists, is well-described.
  • The changelog entries and upgrade guidelines are appropriate for the audience affected by the change (users or developers, depending on the change) and are in the imperative mood (see examples).
    • Fill in the Proposed upgrade guidelines section only if there are breaking changes or changes that may require extra steps from users during upgrade.
  • There is automated testing or an explanation as to why this change has no tests.
  • New public classes, fields, and methods are annotated with @Restricted or have @since TODO Javadocs, as appropriate.
  • New deprecations are annotated with @Deprecated(since = "TODO") or @Deprecated(forRemoval = true, since = "TODO"), if applicable.
  • New or substantially changed JavaScript is not defined inline and does not call eval to ease future introduction of Content Security Policy (CSP) directives (see documentation).
  • For dependency updates, there are links to external changelogs and, if possible, full differentials.
  • For new APIs and extension points, there is a link to at least one consumer.

Desired reviewers

@mention

Maintainer checklist

Before the changes are marked as ready-for-merge:

  • There are at least two (2) approvals for the pull request and no outstanding requests for change.
  • Conversations in the pull request are over, or it is explicit that a reviewer is not blocking the change.
  • Changelog entries in the pull request title and/or Proposed changelog entries are accurate, human-readable, and in the imperative mood.
  • Proper changelog labels are set so that the changelog can be generated automatically.
  • If the change needs additional upgrade steps from users, the upgrade-guide-needed label is set and there is a Proposed upgrade guidelines section in the pull request title (see example).
  • If it would make sense to backport the change to LTS, a Jira issue must exist, be a Bug or Improvement, and be labeled as lts-candidate to be considered (see query).

@basil basil added the skip-changelog Should not be shown in the changelog label Dec 7, 2022
@basil basil marked this pull request as ready for review December 7, 2022 18:20
@NotMyFault NotMyFault requested a review from a team December 7, 2022 20:34
Copy link
Member Author

@basil basil left a comment

Choose a reason for hiding this comment

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

This PR is now ready for merge. We will merge it after approximately 24 hours if there is no negative feedback. Please see the merge process documentation for more information about the merge process. Thanks!

@basil basil added the ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback label Dec 7, 2022
@basil basil merged commit 668e650 into jenkinsci:master Dec 8, 2022
@basil basil deleted the workaround branch December 8, 2022 14:10
@jglick
Copy link
Member

jglick commented Dec 12, 2022

Could revert this as part of #7514 though I am not sure there is a reason to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback skip-changelog Should not be shown in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants