gnodet commented on issue #285: URL: https://github.com/apache/maven-clean-plugin/issues/285#issuecomment-5803624888
Two things to address here: **1. Better error messages (MCLEAN-124 / #180)** The improvement to surface the actual `IOException` detail (e.g. "The process cannot access the file because it is being used by another process") was already implemented in issue [#180](https://github.com/apache/maven-clean-plugin/issues/180) for the 3.x branch (commit `cb2127f`) and merged into 4.x as part of commit `282cf61`. So the cryptic "Failed to delete" message with no cause should already be improved in the current 4.x codebase — if you're still seeing it without a cause, please check which version you're running. **2. The random deletion failures themselves** The underlying issue (file locked by virus scanner, Windows Defender, or search indexer on AzDO agents) is addressed by `retryOnError=true` (already the default) combined with a short delay. However, the retry in the non-fast code path uses per-file `System.gc()` calls which can be expensive (see [#120 / MCLEAN-102](https://github.com/apache/maven-clean-plugin/issues/120)). PR [#328](https://github.com/apache/maven-clean-plugin/pull/328), which is currently open, introduces a session-scoped `BackgroundCleaner` with a smarter **batch retry** strategy: walk the entire tree once, collect all failures, sleep once, then retry the failed set together — eliminating the per-file GC pauses. This should also help on AzDO Windows agents where locks are held briefly by scanning processes. If `fast=true` is not set, the regular `Cleaner` path still applies. The question of whether the batch-retry strategy should also be available in the non-fast path is tracked separately (see discussion on #281). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
