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

Fix generating empty cache on controller #61

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

gmshake
Copy link

@gmshake gmshake commented May 24, 2024

ZipExtractionInstaller.performInstallation() will invoke FilePath.installIfNecessaryFrom() to extract tar ball. When there is no connection to the binary_link and the filepath expected exists, no exception will be thrown thus it falls though to generate and send an emptly cache file to the master. Next rounds requests to install the same JDK tool will result in empty tool directory on slave nodes.

Fix that by skip creating empty tool directory on slave nodes.

Testing done

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
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

ZipExtractionInstaller.performInstallation() will invoke
FilePath.installIfNecessaryFrom() to extract tar ball. When there
is no connection to the binary_link and the filepath `expected`
exists, no exception will be thrown thus it falls though to
generate and send an emptly cache file to the master. Next rounds
requests to install the same JDK tool will result in empty tool
directory on slave nodes.

Fix that by skip creating empty tool directory on slave nodes.
@gmshake gmshake requested a review from a team as a code owner May 24, 2024 09:44
Copy link
Contributor

@MarkEWaite MarkEWaite left a comment

Choose a reason for hiding this comment

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

Please provide a test that shows the failure before your change and does not show the failure after your change.

The expected.deleteRecursive(); that precedes the line you removed is intended to remove the directory expected and its chilldren then expected.mkdirs() recreates the directory expected.

@MarkEWaite
Copy link
Contributor

I don't understand what you mean when you say:

When there is no connection to the binary_link and the filepath expected exists

I see no mention of binary_link in any of the code, either Jenkins core or in the plugin. Can you explain further?

@MarkEWaite MarkEWaite changed the title Fix generating empty cache on master Fix generating empty cache on controller May 25, 2024
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