Bazaar crashes with 'Too many open files' error when removing a directory with many children

Bug #584530 reported by Jamu Kakar
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
New
Undecided
Unassigned

Bug Description

I have a project with a top-level src/ directory. All the code in
the project is in a package called 'canonical'. We have a mix of
4414 files and folders in src/canonical. I want to make 'canonical'
a top-level directory and get rid of 'src'. I did the following the
from the top-level directory:

bzr mv src/canonical canonical
bzr rm src

When running the rm command I ran into the following issue:

0.026 bazaar version: 2.1.1
0.026 bzr arguments: [u'rm', u'src/']
0.036 looking for plugins in /home/jkakar/.bazaar/plugins
0.066 looking for plugins in /usr/lib/python2.6/dist-packages/bzrlib/plugins
0.081 encoding stdout as sys.stdout encoding 'UTF-8'
0.122 opening working tree '/home/jkakar/src/canonical/landscape/branches/better-source-layout'
3.326 Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 853, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 1055, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 661, in run_argv_aliases
    return self.run_direct(**all_cmd_args)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 665, in run_direct
    return self._operation.run_simple(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/cleanup.py", line 122, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/cleanup.py", line 156, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/builtins.py", line 1542, in run
    force=file_deletion_strategy=='force')
  File "/usr/lib/python2.6/dist-packages/bzrlib/mutabletree.py", line 49, in tree_write_locked
    return unbound(self, *args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/workingtree.py", line 2002, in remove
    want_unversioned=True, specific_files=files):
  File "_dirstate_helpers_pyx.pyx", line 1410, in bzrlib._dirstate_helpers_pyx.ProcessEntryC.__next__
  File "_dirstate_helpers_pyx.pyx", line 1579, in bzrlib._dirstate_helpers_pyx.ProcessEntryC._iter_next
  File "_dirstate_helpers_pyx.pyx", line 1556, in bzrlib._dirstate_helpers_pyx._iter_next
  File "/usr/lib/python2.6/dist-packages/bzrlib/osutils.py", line 1704, in _walkdirs_utf8
    dirblock = sorted(read_dir(relroot, top))
  File "_readdir_pyx.pyx", line 238, in bzrlib._readdir_pyx.UTF8DirReader.read_dir
  File "_readdir_pyx.pyx", line 308, in bzrlib._readdir_pyx._read_dir
  File "_readdir_pyx.pyx", line 278, in bzrlib._readdir_pyx.raise_os_error
OSError: [Errno 24] open: Too many open files: '.'

Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 584530] [NEW] Bazaar crashes with 'Too many open files' error when removing a directory with many children

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

Jamu Kakar wrote:
> Public bug reported:
>
> I have a project with a top-level src/ directory. All the code in
> the project is in a package called 'canonical'. We have a mix of
> 4414 files and folders in src/canonical. I want to make 'canonical'
> a top-level directory and get rid of 'src'. I did the following the
> from the top-level directory:
>
> bzr mv src/canonical canonical
> bzr rm src
>
> When running the rm command I ran into the following issue:

I think this is a side effect of bug #582656. I'll mark it as such.

In the short term, you could 'rm _readdir_pyx.so', or apply the one line
patch and rebuild.

The next release of 2.0, 2.1 and 2.2 will all have this fixed.

John
=:->

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

iEYEARECAAYFAkv5SIcACgkQJdeBCYSNAANBlwCgiTq78bOa0uTG+GJDZiJYJUrN
sRgAn2heHy9Pc7NZFd544cMnSHz93syR
=JUpd
-----END PGP SIGNATURE-----

Revision history for this message
Jamu Kakar (jkakar) wrote :

John:

Thanks. In fact, it wasn't a blocker. After doing 'bzr mv
src/canonical canonical' I did a 'bzr commit'. After that, 'bzr rm
src' worked fine.

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.