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

InboundAgentRule should use a temp file for agent.jar #843

Merged
merged 1 commit into from
Sep 20, 2024

Conversation

jglick
Copy link
Member

@jglick jglick commented Sep 20, 2024

Comment on lines +497 to +498
File agentJar = Files.createTempFile(Path.of(System.getProperty("java.io.tmpdir")), "agent", ".jar").toFile();
FileUtils.copyURLToFile(new Slave.JnlpJar("agent.jar").getURL(), agentJar);
Copy link
Member

Choose a reason for hiding this comment

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

I'm guessing that this is to protect against a single Test having multiple threads that call start() on 2 different agents sumultaneously to avoid any synchronization around the file.

@jglick jglick merged commit fd344a6 into jenkinsci:master Sep 20, 2024
14 checks passed
@jglick jglick deleted the agent.jar branch September 20, 2024 20:40
@jglick jglick restored the agent.jar branch September 20, 2024 20:40
@jglick jglick deleted the agent.jar branch September 20, 2024 20:40
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.

3 participants