-
Notifications
You must be signed in to change notification settings - Fork 93
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
Conversation
There was a problem hiding this 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
@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 |
There was a problem hiding this 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 |
There was a problem hiding this comment.
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
durable-task-plugin/src/main/java/org/jenkinsci/plugins/durabletask/FileMonitoringTask.java
Line 487 in 8ea90b6
controlDir(workspace).deleteRecursive(); |
(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 |
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. |
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. |
https://issues.jenkins.io/browse/JENKINS-70874
Testing done
Submitter checklist