-
Notifications
You must be signed in to change notification settings - Fork 76
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
Plugin causes the build to hang with no other information logged #468
Comments
The root cause is in actually in jgit, in the class FS, or really the private internal class FileStoreAttributeCache and its constructor:
The problem is that FileUtils.touch(probe) (which just opens an output stream on the file) doesn't actually update the file's timestamp in our particular scenario. I pulled the jgit code and built from the HEAD of the master branch (there have been quite a few changes in this area of the code), ended up with version 5.12.0-SNAPSHOT of jgit, changed 0.12.3 of gradle-git-version to use that version of jgit instead of the older 5.3.2.201906051522-r it currently uses, re-built the gradle-git-version plugin, and tested that out. That fixes the problem. So it looks like the fix is to update to some later release of jgit, although I tried with v5.11.0.202103091610-r and ended up with the same result. We're able to use version 0.12.1 of this plugin to work around the issue. |
Is this still a problem in 0.13.0? |
@rherrick I bumped up the jgit version, see if that works for you. |
It works for us now. |
What happened?
On a new Jenkins server, a couple of our builds that work locally and on an old Jenkins server were hanging. I looked into it and narrowed the cause down to the the com.palantir.git-version plugin: if I remove the references to this plugin, the build works fine. If I include this plugin (even if I don't reference any tasks or methods from the plugin), it hangs and just cycles on the daemon waiting to acquire a lock, acquiring a lock, then releasing the lock (including when I run the build with the --no-daemon flag specified explicitly and/or org.gradle.daemon set to false in ~/.gradle/gradle.properties.
For reference, the builds that we're having trouble with are the master branches of these two repos:
I've found a few clues that may help and tried a few things that didn't help:
I ran these builds both on the Jenkins server (not under Jenkins, just on the same machine) and locally with debug logging on and captured the output. You can find both the raw log files here, as well as the logs filtered down to just show lines that include references to git, palantir, or version, in order to better focus on what's actually happening with the plugin:
https://gist.github.com/rherrick/9894271ad99ba50fc405ae2a4d3d870f
The interesting difference can be seen in the difference between failing-gitversion-log and working-gitversion-log. In both cases, the plugin starts to apply the plugin to the project:
When things work, it then proceeds:
When things don't work, the build process just starts to cycle:
That waiting/acquired/releasing cycle is exactly what the Gradle daemon does when there's no work to do, but in this case it happens even when the build is run without the daemon (or at least the persistent daemon).
What did you want to happen?
Complete the build!
The text was updated successfully, but these errors were encountered: