Exception "bzr: ERROR: Could not acquire lock" occurs very often.

Bug #814408 reported by IWATA Hidetaka
26
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Bazaar Explorer
Fix Released
High
Jonathan Riddell

Bug Description

By newest release(1.2.0),
I see exception dialog very very often, which says "bzr: ERROR: Could not acquire lock".
It occurs after executing commit, push, pull, and other many commands.

Turning off 'Automatically refresh status report' does not solve it.
(BTW, I doubt that this preference does not work,
 because bzr-explorer still puts "QFileSystemWatcher: failed to add paths. ・・・" to console after turning off this.)

TRACEBACK(In .bzr.log)
------------------------
60.548 Traceback (most recent call last):
  File "***\explorer\lib\view_workingtree.py", line 124, in refresh_view
    self.status_view.refresh_view()
  File "***\explorer\lib\html_report_view.py", line 56, in refresh_view
    lines = self.report_text()
  File "***\explorer\lib\view_workingtree.py", line 138, in report_text
    model.relpath)
  File "***\explorer\lib\status_report.py", line 196, in __init__
    self._collect_data()
  File "***\explorer\lib\status_report.py", line 210, in _collect_data
    pending_merges = status_data.get_pending_merges(wt)
  File "***\explorer\lib\status_data.py", line 90, in get_pending_merges
    status.show_pending_merges(wt, to_file=sio, verbose=verbose)
  File "***\\lib\site-packages\bzrlib\status.py", line 261, in show_pending_merges
    parents = new.get_parent_ids()
  File "***\\lib\site-packages\bzrlib\decorators.py", line 152, in read_locked
    self.lock_read()
  File "***\\lib\site-packages\bzrlib\workingtree_4.py", line 613, in lock_read
    state.lock_read()
  File "***\\lib\site-packages\bzrlib\dirstate.py", line 3349, in lock_read
    self._lock_token = lock.ReadLock(self._filename)
  File "***\\lib\site-packages\bzrlib\lock.py", line 380, in __init__
    win32file.FILE_SHARE_READ, os.O_RDONLY, "rb")
  File "***\\lib\site-packages\bzrlib\lock.py", line 365, in _open
    raise errors.LockContention(filename, e)
LockContention: Could not acquire lock "***/m4_work/.bzr/checkout/dirstate": (32, 'CreateFileW', ***)

VERSION
--------
Bazaar (bzr) 2.4b5
  Python interpreter: C:\DEVELOP\py_envs\bzr2.4\Scripts\python.exe 2.6.6
  Python standard library: C:\DEVELOP\py_envs\bzr2.4\lib
  Platform: Windows-7-6.1.7600
  bzrlib: C:\DEVELOP\py_envs\bzr2.4\lib\site-packages\bzrlib
  Bazaar configuration: C:\Users\iwata\AppData\Roaming\bazaar\2.0
  Bazaar log file: C:\Users\iwata\Documents\.bzr.log

Related branches

Revision history for this message
IWATA Hidetaka (hid-iwata) wrote :

I think, background status refreshing should ignore lock error (and retry after a interval), or notify it by something like a baloon, not a modal dialog.

Revision history for this message
Jonathan Riddell (jr) wrote :

Confirmed, I can recreate this by running an external bzr commit on a branch which is open in explorer

Changed in bzr-explorer:
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Jonathan Riddell (jr) wrote :
Revision history for this message
IWATA Hidetaka (hid-iwata) wrote : Re: [Bug 814408] Re: Exception "bzr: ERROR: Could not acquire lock" occurs very often.

I tried it. And it works well.
Thank you.
2011/07/28 22:55 "Jonathan Riddell" <email address hidden>:
> Please test https://code.launchpad.net/~jr/bzr-explorer/814408-lock-
> contention/+merge/69653
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/814408
>
> Title:
> Exception "bzr: ERROR: Could not acquire lock" occurs very often.
>
> Status in Bazaar Explorer:
> Confirmed
>
> Bug description:
> By newest release(1.2.0),
> I see exception dialog very very often, which says "bzr: ERROR: Could not
acquire lock".
> It occurs after executing commit, push, pull, and other many commands.
>
> Turning off 'Automatically refresh status report' does not solve it.
> (BTW, I doubt that this preference does not work,
> because bzr-explorer still puts "QFileSystemWatcher: failed to add paths.
・・・" to console after turning off this.)
>
>
> TRACEBACK(In .bzr.log)
> ------------------------
> 60.548 Traceback (most recent call last):
> File "***\explorer\lib\view_workingtree.py", line 124, in refresh_view
> self.status_view.refresh_view()
> File "***\explorer\lib\html_report_view.py", line 56, in refresh_view
> lines = self.report_text()
> File "***\explorer\lib\view_workingtree.py", line 138, in report_text
> model.relpath)
> File "***\explorer\lib\status_report.py", line 196, in __init__
> self._collect_data()
> File "***\explorer\lib\status_report.py", line 210, in _collect_data
> pending_merges = status_data.get_pending_merges(wt)
> File "***\explorer\lib\status_data.py", line 90, in get_pending_merges
> status.show_pending_merges(wt, to_file=sio, verbose=verbose)
> File "***\\lib\site-packages\bzrlib\status.py", line 261, in
show_pending_merges
> parents = new.get_parent_ids()
> File "***\\lib\site-packages\bzrlib\decorators.py", line 152, in
read_locked
> self.lock_read()
> File "***\\lib\site-packages\bzrlib\workingtree_4.py", line 613, in
lock_read
> state.lock_read()
> File "***\\lib\site-packages\bzrlib\dirstate.py", line 3349, in lock_read
> self._lock_token = lock.ReadLock(self._filename)
> File "***\\lib\site-packages\bzrlib\lock.py", line 380, in __init__
> win32file.FILE_SHARE_READ, os.O_RDONLY, "rb")
> File "***\\lib\site-packages\bzrlib\lock.py", line 365, in _open
> raise errors.LockContention(filename, e)
> LockContention: Could not acquire lock
"***/m4_work/.bzr/checkout/dirstate": (32, 'CreateFileW', ***)
>
>
> VERSION
> --------
> Bazaar (bzr) 2.4b5
> Python interpreter: C:\DEVELOP\py_envs\bzr2.4\Scripts\python.exe 2.6.6
> Python standard library: C:\DEVELOP\py_envs\bzr2.4\lib
> Platform: Windows-7-6.1.7600
> bzrlib: C:\DEVELOP\py_envs\bzr2.4\lib\site-packages\bzrlib
> Bazaar configuration: C:\Users\iwata\AppData\Roaming\bazaar\2.0
> Bazaar log file: C:\Users\iwata\Documents\.bzr.log
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/bzr-explorer/+bug/814408/+subscriptions

Jonathan Riddell (jr)
Changed in bzr-explorer:
status: Confirmed → Fix Released
Changed in bzr-explorer:
milestone: none → 1.2.1
assignee: nobody → Jonathan Riddell (jr)
Revision history for this message
André Bachmann (andrebachmann-dd) wrote :

Just tested with bzr 2.4.2, latest qbzr trunk and bzr-explorer trunk on Win7.

I reported bug #806982, which was marked as a duplicate from this bug. I just tested my steps from https://bugs.launchpad.net/bzr-explorer/+bug/806982 and there is indeed a change. When I execute step 4 (running "bzr remove-tree c:\spielwiese\testen\trunk"), I get an error message from bzr:

bzr: ERROR: Directory not empty: "C:/spielwiese/testen/trunk/.bzr/checkout": [Er
ror 145] Das Verzeichnis ist nicht leer: u'C:/spielwiese/testen/trunk/.bzr/check
out'

At the same time, my bzr-explorer also shows an error message:

bzr: ERROR: invalid header line: ''

I attached my .bzr.log.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Bug attachments

Remote bug watches

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