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-70874] Fix 'Text file busy' issue #204

Merged
merged 2 commits into from
Feb 6, 2024

Conversation

ckullabosch
Copy link
Contributor

@ckullabosch ckullabosch commented Feb 2, 2024

https://issues.jenkins.io/browse/JENKINS-70874

Testing done

Submitter checklist

Preview Give feedback

@ckullabosch ckullabosch requested a review from a team as a code owner February 2, 2024 06:48
@ckullabosch ckullabosch changed the title [JENKINS-70784] Fix 'Text file busy' issue [JENKINS-70874] Fix 'Text file busy' issue Feb 2, 2024
@jglick jglick added the bug label Feb 2, 2024
Copy link
Member

@jglick jglick left a comment

Choose a reason for hiding this comment

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

A bit difficult to follow all the discussions but IIUC this is a workaround for https://bugs.openjdk.org/browse/JDK-8068370? If so it would be a good idea to mention that in a comment so if the bug is ever fixed we can remember to clean up.

I was able to reproduce the problem also with binary wrappers

So perhaps https://github.com/jenkinsci/lib-durable-task/blob/c21401976ffc312bfc68c2ea647a577c25f9d077/src/cmd/bash/durable_task_monitor.go#L50-L54 also needs patching?

Also see jenkinsci/git-client-plugin#313 and CC @MarkEWaite @car-roll who might have more context

@ckullabosch
Copy link
Contributor Author

@jglick My understanding is that this not a JDK level problem. It's an inherent problem, when forking and writing executable files concurrently (independent of the language used). The issue in https://bugs.openjdk.org/browse/JDK-8068370 is probably the same root cause (but not fixable inside the JVM). You are right that lib-durable-task needs a fix as well. Please see here for more background information: https://issues.jenkins.io/browse/JENKINS-48258?focusedId=336050&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-336050

Copy link
Member

@jglick jglick left a comment

Choose a reason for hiding this comment

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

Patch itself seems reasonable. Will leave open for a bit to see if anyone else cares to comment on the approach.

@@ -229,27 +231,32 @@ private List<String> scriptLauncherCmd(ShellController c, FilePath ws, @CheckFor
if (os == OsType.WINDOWS) { // JENKINS-40255
scriptPath = scriptPath.replace("\\", "/"); // cygwin sh understands mixed path (ie : "c:/jenkins/workspace/script.sh" )
}
String scriptPathCopy = scriptPath + ".copy"; // copy file to protect against "Text file busy", see JENKINS-70874
Copy link
Member

Choose a reason for hiding this comment

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

Ought to be covered by

I think.

@jglick
Copy link
Member

jglick commented Feb 2, 2024

(Can I assume that the problem was reproducible locally without this patch, and corrected when running with this patch? If you are not familiar with Jenkins plugin development generally, the easiest way is to use mvn hpi:run.)

@ckullabosch
Copy link
Contributor Author

Yes, I did run tests for multiple hours and have not seen the issue again after applying the fix. Nevertheless it's happening very rare and is hard to reproduce.

@ckullabosch
Copy link
Contributor Author

The git-client plugin needs also a fix for the "Text file busy" issue, please see jenkinsci/git-client-plugin#1103 and https://issues.jenkins.io/browse/JENKINS-72667.

@jglick jglick merged commit 0930093 into jenkinsci:master Feb 6, 2024
14 checks passed
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