[GRADLE-2498] IOException during compareGradleBuilds Created: 26/Sep/12  Updated: 10/Feb/17  Resolved: 10/Feb/17

Status: Resolved
Project: Gradle
Affects Version/s: 1.2
Fix Version/s: None

Type: Bug
Reporter: Björn Kautler Assignee: Unassigned
Resolution: Won't Fix Votes: 0


I tried to do a compareGradleBuilds by adding

if (gradle.gradleVersion == '1.2') {
   apply plugin: 'compare-gradle-builds'
   compareGradleBuilds {
      sourceBuild {
         gradleVersion = '1.0'

to my Gradle 1.0 build and changing the gradle-wrapper.properties to 1.2.

After executing './gradlew cGB' it completed the targetBuild. After that it wanted to execute the sourceBuild. But there during the clean phase there was the following exception:


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':cache:clean'.
> java.io.IOException: Unable to delete file: censored\cache\build\libs\cache-shared-server-5.0.RC0.jar

I then looked at the process list and found a dozen or so gradle processes that eat memory and lock files like the one above.
I guess this has not completely to do with compareGradleBuilds as a colleague also regularly has to kill dozens of Gradle processes that hang around and eat memory.

Nevertheless I killed all those processes and tried again, but I still get the same error message and I'm left with two Daemon processes, one for 1.0, one for 1.2 where the 1.2 one locks that file that the 1.0 one wants to delete during clean.

Then I executed it again without killing anything and now get the message already with the target build. I then killed the 1.2 Daemon process and run it again, then the target build succeeded again. Right after the target build being finished during buildSrc compilation of the source build I then killed the 1.2 Daemon process and thus released the file lock. Then the 1.0 Daemon process was able to delete the file during clean phase and the source build succeeded.
To make the timing easier I tried to add "System.console().readLine('Press ENTER to continue ')" to the master build at configuration time so that I don't have to manually watch and get the right time to kill the 1.2 Daemon process manually, but unfortunately this didn't work when executing cGB, only when doing a normal execution as there is no System Console when running through the Daemon. "if (gradle.gradleVersion == '1.0')

{ println 'Press ENTER to continue'; System.in.read() }

" also did not work, it printed the prompt, but continued without waiting for input. I ended up doing just "if (gradle.gradleVersion == '1.0') { 100.times

{ println 'KILL IT ' * 30 }

; sleep 60000 }" and hoping to see it within that minute.

Comment by Benjamin Muschko [ 15/Nov/16 ]

As announced on the Gradle blog we are planning to completely migrate issues from JIRA to GitHub.

We intend to prioritize issues that are actionable and impactful while working more closely with the community. Many of our JIRA issues are inactionable or irrelevant. We would like to request your help to ensure we can appropriately prioritize JIRA issues you’ve contributed to.

Please confirm that you still advocate for your JIRA issue before December 10th, 2016 by:

  • Checking that your issues contain requisite context, impact, behaviors, and examples as described in our published guidelines.
  • Leave a comment on the JIRA issue or open a new GitHub issue confirming that the above is complete.

We look forward to collaborating with you more closely on GitHub. Thank you for your contribution to Gradle!

Comment by Benjamin Muschko [ 10/Feb/17 ]

Thanks again for reporting this issue. We haven't heard back from you after our inquiry from November 15th. We are closing this issue now. Please create an issue on GitHub if you still feel passionate about getting it resolved.

Generated at Wed Jun 30 12:23:35 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.