Gradle

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What’s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
To raise new issues or bugs against Gradle, please use forums.gradle.org.
  • Gradle
  • GRADLE-2244

Cleaning should be more robust on Windows

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Improvement Improvement
  • Status: Resolved Resolved
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.1-rc-1

Description

I'm seeing this on windows when the indexer is on.

It manifests as java.io.IOException: Unable to delete file/directory, and then a subsequent clean will succeed.

We could cater for this by noting that a particular operation failed, and then retrying it again at the end or after some time.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • History
  • Activity
  • TeamCity
  • Commits
  • Source
  • Reviews
Hide
Permalink
Szczepan Faber added a comment - 23/Apr/12 12:16 AM

If we develop this feature they will probably have to remember all undeletable dirs. So I'd vote to also improve the error message to include the list of all dirs that the build could not delete at clean. This would be very useful in windows.

Show
Szczepan Faber added a comment - 23/Apr/12 12:16 AM If we develop this feature they will probably have to remember all undeletable dirs. So I'd vote to also improve the error message to include the list of all dirs that the build could not delete at clean. This would be very useful in windows.
Pivotal Tracker Integration made changes - 24/May/12 3:06 AM
Field Original Value New Value
Status Open [ 1 ] In Progress [ 3 ]
Hide
Create a new review for changeset 5a5b860b48642d00bb736ce9fbaf96dc40563fb5
Luke Daley <ld@ldaley.com> submitted changeset 5a5b860b48642d00bb736ce9fbaf96dc40563fb5 to pull-request-138 in Gradle (1 file) - 21/Jul/12 5:15 AM

GRADLE-2244 - try to make cleaning more robust on Windows.
This is based on code in Ant that deals with deleting files. It eludes to there being a bug in Windows JDKs that is “fixable” by running a GC when a file files to delete and then trying again. Some googling finds similar information, but I haven't been able to find a definitive reference.

There is no added coverage for this as I'm unsure how to write a reliable test at this time. It can be manually tested though.

  • subprojects/core/src/main/groovy/org/gradle/api/internal/file/copy/DeleteActionImpl.java (+27 -0)
    • View diff to previous
    • View full source
    • View file history
    • Download raw file
Show
Create a new review for changeset 5a5b860b48642d00bb736ce9fbaf96dc40563fb5
Luke Daley <ld@ldaley.com> submitted changeset 5a5b860b48642d00bb736ce9fbaf96dc40563fb5 to pull-request-138 in Gradle (1 file) - 21/Jul/12 5:15 AM
Hide
Permalink
Luke Daley added a comment - 21/Jul/12 5:17 AM

Szczepan,

I'm inclined not to include this. The reason is that it actually makes the logic non trivially more complex, and would only really help in the situation where someone has asked to delete multiple roots which is rare. Typically the delete is just operating on the “build dir”.

Show
Luke Daley added a comment - 21/Jul/12 5:17 AM Szczepan, I'm inclined not to include this. The reason is that it actually makes the logic non trivially more complex, and would only really help in the situation where someone has asked to delete multiple roots which is rare. Typically the delete is just operating on the “build dir”.
Luke Daley made changes - 23/Jul/12 5:05 PM
Fix Version/s 1.1-rc-1 [ 10360 ]
Adam Murdoch made changes - 23/Jul/12 5:16 PM
Resolution Fixed [ 1 ]
Status In Progress [ 3 ] Resolved [ 5 ]
Luke Daley made changes - 23/Jul/12 5:17 PM
Summary Cleaning should be more robust (e.g. to deal with OS indexers that quickly lock/unlock files) Cleaning should be more robust on Windows
Hide
Permalink
Luke Daley added a comment - 23/Jul/12 5:18 PM

After some research, it appears that this may be due to a bug in the Windows JDKs (incl IBM). Ant uses a strategy of forcing a GC after a failed delete and then waiting a small amount of time. Given that this appears to be a successful strategy for Ant, we have adopted it.

Show
Luke Daley added a comment - 23/Jul/12 5:18 PM After some research, it appears that this may be due to a bug in the Windows JDKs (incl IBM). Ant uses a strategy of forcing a GC after a failed delete and then waiting a small amount of time. Given that this appears to be a successful strategy for Ant, we have adopted it.
Luke Daley made changes - 23/Jul/12 5:18 PM
Assignee Luke Daley [ ldaley ]
Pivotal Tracker Integration made changes - 24/Jul/12 3:08 PM
Status Resolved [ 5 ] Closed [ 6 ]
Luke Daley made changes - 03/Jan/13 5:09 AM
Workflow jira with pivotal tracker [ 15595 ] jira with pivotal tracker (no resolved, only closed) [ 17668 ]
Luke Daley made changes - 04/Jan/13 5:10 AM
Status Closed [ 6 ] Resolved [ 5 ]
Workflow jira with pivotal tracker (no resolved, only closed) [ 17668 ] Copy of jira with pivotal tracker (no closed, only resolved) [ 20303 ]
Unable to get TeamCity builds: No active plugin license is found! Please visit http://stiltsoft.com/teamcity for details

People

  • Assignee:
    Luke Daley
    Reporter:
    Luke Daley
Vote (0)
Watch (1)

Dates

  • Created:
    19/Apr/12 6:18 AM
    Updated:
    04/Jan/13 5:10 AM
    Resolved:
    23/Jul/12 5:16 PM
  • Atlassian JIRA (v5.0.3#729-sha1:bf569e4)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Gradle. Try JIRA - bug tracking software for your team.