TooManyConcurrentRequests raised when bzr+ssh push is interrupted

Bug #144627 reported by Martin Pool
6
Affects Status Importance Assigned to Milestone
Bazaar
Triaged
Medium
Unassigned

Bug Description

Andrew Hunter reports:

Bzr does not handle a keyboard interupt (Ctl+c) nicely during a push. It
gives the following traceback:

bzr: ERROR: bzrlib.errors.TooManyConcurrentRequests: The medium
'<bzrlib.smart.medium.SmartSSHClientMedium object at 0x13f88f0>' has
reached its concurrent request limit. Be sure to finish_writing and
finish_reading on the currently open request.

Traceback (most recent call last):
  File "/opt/local/lib/python2.4/site-packages/bzrlib/commands.py",
line 817, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/opt/local/lib/python2.4/site-packages/bzrlib/commands.py",
line 779, in run_bzr
    ret = run(*run_argv)
  File "/opt/local/lib/python2.4/site-packages/bzrlib/commands.py",
line 477, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/opt/local/lib/python2.4/site-packages/bzrlib/builtins.py",
line 763, in run
    revision_id=br_from.last_revision())
  File "/opt/local/lib/python2.4/site-packages/bzrlib/bzrdir.py", line
190, in clone_on_transport
    revision_id=revision_id)
  File "/opt/local/lib/python2.4/site-packages/bzrlib/decorators.py",
line 127, in read_locked
    return unbound(self, *args, **kwargs)
  File "/opt/local/lib/python2.4/site-packages/bzrlib/repository.py",
line 489, in clone
    self.copy_content_into(dest_repo, revision_id)
  File "/opt/local/lib/python2.4/site-packages/bzrlib/repository.py",
line 412, in copy_content_into
    return InterRepository.get(self, destination).copy_content(revision_id)
  File "/opt/local/lib/python2.4/site-packages/bzrlib/decorators.py",
line 167, in write_locked
    self.unlock()
  File "/opt/local/lib/python2.4/site-packages/bzrlib/inter.py", line
110, in unlock
    self.target.unlock()
  File "/opt/local/lib/python2.4/site-packages/bzrlib/repository.py",
line 475, in unlock
    self.control_files.unlock()
  File
"/opt/local/lib/python2.4/site-packages/bzrlib/lockable_files.py", line
294, in unlock
    self._lock.unlock()
  File "/opt/local/lib/python2.4/site-packages/bzrlib/lockdir.py", line
298, in unlock
    self.confirm()
  File "/opt/local/lib/python2.4/site-packages/bzrlib/lockdir.py", line
386, in confirm
    info = self.peek()
  File "/opt/local/lib/python2.4/site-packages/bzrlib/lockdir.py", line
409, in peek
    info = self._read_info_file(self._held_info_path)
  File "/opt/local/lib/python2.4/site-packages/bzrlib/lockdir.py", line
399, in _read_info_file
    return self._parse_info(self.transport.get(path))
  File
"/opt/local/lib/python2.4/site-packages/bzrlib/transport/remote.py",
line 192, in get
    return StringIO(self.get_bytes(relpath))
  File
"/opt/local/lib/python2.4/site-packages/bzrlib/transport/remote.py",
line 196, in get_bytes
    request = self.get_smart_medium().get_request()
  File "/opt/local/lib/python2.4/site-packages/bzrlib/smart/medium.py",
line 412, in get_request
    return SmartClientStreamMediumRequest(self)
  File "/opt/local/lib/python2.4/site-packages/bzrlib/smart/medium.py",
line 566, in __init__
    raise errors.TooManyConcurrentRequests(self._medium)
TooManyConcurrentRequests: The medium
'<bzrlib.smart.medium.SmartSSHClientMedium object at 0x13f88f0>' has
reached its concurrent request limit. Be sure to finish_writing and
finish_reading on the currently open request.

bzr 0.90.0 on python 2.4.4.final.0 (darwin)
arguments: ['/opt/local/bin/bzr', 'push',
'bzr+ssh://<email address hidden>/~rexbron/freemix/fremix-legal-update']

** please send this report to <email address hidden>

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

We're trying to unlock the remote repository, but the smart server medium is still in use by the interrupted operation.

I can see two options:
 * unlock should drain out the medium, discarding the current response, before sending its unlock request
 * delegate responsibility for releasing the lock to the server, when the medium is dropped -- but in general we have said we will allow clients to hold locks across connections.

Changed in bzr:
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 144627] Re: TooManyConcurrentRequests raised when bzr+ssh push is interrupted

There is a third option: Catch the exception and cleanup the operation
'properly' - which could be more than just draining the current body.

-Rob

Revision history for this message
Aaron Bentley (abentley) wrote : Re: [Bug 144627] TooManyConcurrentRequests raised when bzr+ssh push is interrupted

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

Martin Pool wrote:
> Public bug reported:
>
> Andrew Hunter reports:
>
> Bzr does not handle a keyboard interupt (Ctl+c) nicely during a push. It
> gives the following traceback:

This looks like the same bug I tried to fix here:

http://bundlebuggy.aaronbentley.com/request/%<email address hidden>%3E

I'm not working on that patch anymore, since I don't have the knowledge
to do it "right".

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFG+RYg0F+nu1YWqI0RAlDvAJ0ctrrpLeqyP+1hgnAerqgGSNAYrQCff0Kg
BMNA1nVGNuiEr1XPtenhTPM=
=5zfn
-----END PGP SIGNATURE-----

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.