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

Windows machines can't delete workspace files #1573

Closed
M-Davies opened this issue Sep 28, 2020 · 6 comments · Fixed by adoptium/aqa-tests#2059
Closed

Windows machines can't delete workspace files #1573

M-Davies opened this issue Sep 28, 2020 · 6 comments · Fixed by adoptium/aqa-tests#2059
Labels
Milestone

Comments

@M-Davies
Copy link

Windows machines are seeing errors where they struggle to remove a files at various locations. All versions (from what I can see) are affected by this issue and the error message is different for each one but all revolve around failing to delete a file (albeit, there is a lot of spam from other clean up tasks so I can't be sure of that).

12:16:24  rm: cannot remove '/cygdrive/j/jenkins/tmp/workspace/./build//src/build/windows-x86_64-server-release/support/native/java.desktop/libawt': Directory not empty
12:16:26  rm: cannot remove '/cygdrive/j/jenkins/tmp/workspace/./build//src/make': Device or resource busy
12:19:08  warning: failed to remove build/windows-x86_64-normal-clientANDserver-release/make-support/failure-logs: Directory not empty
12:17:39  rm: cannot remove '/cygdrive/c/workspace/openjdk-build/workspace/./build//src/build/windows-x86_64-server-release/make-support/failure-logs': Directory not empty
12:16:47  stderr: warning: failed to remove workspace/build/src/build/windows-x86_64-server-release/make-support/failure-logs: Directory not empty
12:16:47  warning: failed to remove workspace/build/src/build/windows-x86_64-server-release/support/native/java.desktop/libfreetype: Directory not empty
12:16:47  warning: failed to remove workspace/build/src/make: Device or resource busy
@Willsparker
Copy link
Contributor

So, Directory not empty is output from rm when you try and delete a directory that isn't empty (obviously). However, we do appear to be doing this in PrepareWorkspace.sh:

rm -rf "${BUILD_CONFIG[WORKSPACE_DIR]:?}/${BUILD_CONFIG[WORKING_DIR]}/${BUILD_CONFIG[OPENJDK_SOURCE_DIR]}"

In addition, on the build-softlayer-win2012r2-x64-2 (within both the cygwin terminal and cmd), I was about to create a directory, populate it and then delete it with rm -rf with no issues. This makes me think that the error message is false reporting what's going on here.

(While I'm not sure this is exactly the same sort of issue, ref #1396 )

@Willsparker
Copy link
Contributor

It looks like the 2 later ones failed due to a Jenkins git issue first, followed by the cleaning workspace error.
I don't need to manually clear up the workspace however, as it appears that it was able to eventually as the workspace is not a clone of the openjdk-jdk workspace. No stray java processes are on it either ...

@smlambert smlambert added this to To do in Top Priorities via automation Nov 17, 2020
@sxa
Copy link
Member

sxa commented Nov 18, 2020

I have implemented @Willsparker's suggestion (including the commands to kill the processes) into maketest.sh at https://github.com/sxa/openjdk-tests/commits/win_process_killer ... Testing at https://ci.adoptopenjdk.net/job/Grinder/4746/console to see if the code causes any problems. I've also added the logic to check to check , but not kill, rogue processes on UNIX (Copied from SXA-processCheck).

NOTE: As of yesterday the SXA-processCheck job now has an extra (non-default) option to issue kill -KILL if the regular kill doesn't work, as we were seeing a significant build-up of java processes on some machines that were causing tests to get stuck and time out

@sxa
Copy link
Member

sxa commented Nov 18, 2020

SXA-processcheck now modified to show in red (failed) if it is running on a windows box that has more than one java process running (i.e. something other than the agent) but since it's not easy to detect which one is the agent I'm leaving them to be cleared up manually for now, but the job provides a good visual alert

@sxa sxa pinned this issue Nov 18, 2020
infrastructure automation moved this from TODO to Done Nov 18, 2020
Top Priorities automation moved this from To do to Done Nov 18, 2020
@karianna karianna added this to the November 2020 milestone Nov 19, 2020
@sxa sxa unpinned this issue Nov 26, 2020
@sxa
Copy link
Member

sxa commented Dec 23, 2020

Note that as a follow-on to the changes in adoptium/aqa-tests#2059 we have update it to run within the groovy code in order to be able to clean up when jobs are manually aborted or hit their timeout - these changes are in adoptium/aqa-tests#2121

@gdams gdams removed this from Done in Top Priorities May 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

4 participants