bzr clean-tree --force --detritus stops on io error (file in use)

Bug #430785 reported by Lucius
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Medium
Parth Malwankar

Bug Description

bzr v 18.1 on windows.
When running
bzr clean-tree --force --detritus --ignored
clean-tree walks the tree and deletes qualifying files, until it hits the first I/O exception and then stops. Instead the strategy should be "Best effort", which means clean-walk should continue walking and skipping those files that resulted in an exception.

The most important exceptions that should skipped is:

  [Error 32] The process cannot access the file because it is being used by another process

Now, I could kill the process that is locking the file, but that may be impractical. Regardless, best effor strategy in this case makes sense. (In my case my development project is big and loading the projects into my dev tool takes some time. Unfortunately my dev tool is locking one single file, which prevents me from cleaning the tree, unless a close my dev environment.)

Related branches

Revision history for this message
Martin Pool (mbp) wrote :

I agree, we should just give a warning and leave it. It will help a bit if you can post the traceback from bzr.log where this occurred.

Changed in bzr:
status: New → Confirmed
importance: Undecided → Medium
summary: - bzr clean-tree --force --detritus stops when process cannot access a
- file
+ bzr clean-tree --force --detritus stops on io error (file in use)
Revision history for this message
Lucius (luciusf) wrote :

How do I create a traceback?

Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 430785] Re: bzr clean-tree --force --detritus stops on io error (file in use)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Lucius wrote:
> How do I create a traceback?
>

Add -Derror to the command line.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkq3s8gACgkQJdeBCYSNAAMaOwCgpZhCl6Fns7nj2iaFezrBM9Uy
b+cAoNljhNMKpBO/sprrtYvr4O8VaU+p
=rIql
-----END PGP SIGNATURE-----

Revision history for this message
Lucius (luciusf) wrote :

bzr: ERROR: exceptions.WindowsError: [Error 32] The process cannot access the file because it is bei
ng used by another process: u'C:/Users/alias/Depots/foo/main/Source/Backend/Database/Lba.dbmdl'

Traceback (most recent call last):
  File "bzrlib\commands.pyo", line 835, in exception_to_return_code
  File "bzrlib\commands.pyo", line 1030, in run_bzr
  File "bzrlib\commands.pyo", line 647, in run_argv_aliases
  File "bzrlib\builtins.pyo", line 5710, in run
  File "bzrlib\clean_tree.pyo", line 66, in clean_tree
  File "bzrlib\clean_tree.pyo", line 83, in delete_items
WindowsError: [Error 32] The process cannot access the file because it is being used by another proc
ess: u'C:/Users/alias/Depots/foo/main/Source/Backend/Database/Lba.dbmdl'

Revision history for this message
Lucius (luciusf) wrote :

This problem is not fixed yet. It should be a minor code change, catching an IO exception and continue tree walking. I am not familiar with python, otherwise I would just do the change myself.

Martin Pool (mbp)
tags: added: clean-tree easy win32
Parth Malwankar (parthm)
Changed in bzr:
assignee: nobody → Parth Malwankar (parthm)
Parth Malwankar (parthm)
Changed in bzr:
status: Confirmed → In Progress
Parth Malwankar (parthm)
Changed in bzr:
status: In Progress → Fix Released
milestone: none → 2.3b1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.