pull from one ssh branch into another fails with TooManyConcurrentRequests

Bug #626649 reported by Martin Pool
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
High
Unassigned

Bug Description

If you have a checkout of one lp branch, and you try to pull another lp branch into it, this fails with TooManyConcurrentRequests, I would guess because bzr is trying to reuse the ssh connection, but it's not at all reusable.

mbp@grace% bzr pull lp:~bialix/bzr-website/2.2
bzr: ERROR: bzrlib.errors.TooManyConcurrentRequests: The medium 'SmartSSHClientMedium(bzr+ssh://<email address hidden>/)' 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 "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 911, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 1111, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 689, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 704, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/cleanup.py", line 135, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/builtins.py", line 1040, in run
    possible_transports=possible_transports, local=local)
  File "/usr/lib/python2.6/dist-packages/bzrlib/decorators.py", line 194, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/workingtree.py", line 1617, in pull
    local=local)
  File "/usr/lib/python2.6/dist-packages/bzrlib/branch.py", line 1068, in pull
    possible_transports=possible_transports, *args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/decorators.py", line 194, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/branch.py", line 3417, in pull
    run_hooks=False)
  File "/usr/lib/python2.6/dist-packages/bzrlib/decorators.py", line 194, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/remote.py", line 2676, in pull
    _override_hook_target=self, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/branch.py", line 1068, in pull
    possible_transports=possible_transports, *args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/decorators.py", line 194, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/branch.py", line 3421, in pull
    _override_hook_target=_override_hook_target)
  File "/usr/lib/python2.6/dist-packages/bzrlib/branch.py", line 3530, in _pull
    overwrite=overwrite, graph=graph)
  File "/usr/lib/python2.6/dist-packages/bzrlib/branch.py", line 1017, in update_revisions
    overwrite, graph)
  File "/usr/lib/python2.6/dist-packages/bzrlib/decorators.py", line 194, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/branch.py", line 3375, in update_revisions
    self.target.fetch(self.source, stop_revision)
  File "/usr/lib/python2.6/dist-packages/bzrlib/decorators.py", line 194, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/branch.py", line 673, in fetch
    pb=pb)
  File "/usr/lib/python2.6/dist-packages/bzrlib/remote.py", line 1380, in fetch
    find_ghosts=find_ghosts, fetch_spec=fetch_spec)
  File "/usr/lib/python2.6/dist-packages/bzrlib/decorators.py", line 194, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/repository.py", line 3449, in fetch
    find_ghosts=find_ghosts)
  File "/usr/lib/python2.6/dist-packages/bzrlib/fetch.py", line 73, in __init__
    self.__fetch()
  File "/usr/lib/python2.6/dist-packages/bzrlib/fetch.py", line 99, in __fetch
    self._fetch_everything_for_search(search)
  File "/usr/lib/python2.6/dist-packages/bzrlib/fetch.py", line 127, in _fetch_everything_for_search
    stream, from_format, [])
  File "/usr/lib/python2.6/dist-packages/bzrlib/remote.py", line 1841, in insert_stream
    (verb, path, resume_tokens) + lock_args, byte_stream)
  File "/usr/lib/python2.6/dist-packages/bzrlib/smart/client.py", line 181, in call_with_body_stream
    expect_response_body=False)
  File "/usr/lib/python2.6/dist-packages/bzrlib/smart/client.py", line 79, in _call_and_read_response
    readv_body=readv_body, body_stream=body_stream)
  File "/usr/lib/python2.6/dist-packages/bzrlib/smart/client.py", line 61, in _send_request
    encoder.call_with_body_stream((method, ) + args, body_stream)
  File "/usr/lib/python2.6/dist-packages/bzrlib/smart/protocol.py", line 1277, in _iter_with_errors
    yield None, iterator.next()
  File "/usr/lib/python2.6/dist-packages/bzrlib/smart/repository.py", line 505, in _stream_to_byte_stream
    for substream_type, substream in stream:
  File "/usr/lib/python2.6/dist-packages/bzrlib/remote.py", line 2004, in missing_parents_chain
    stream = self._get_stream(source, search)
  File "/usr/lib/python2.6/dist-packages/bzrlib/remote.py", line 1971, in _get_stream
    verb, args, search_bytes)
  File "/usr/lib/python2.6/dist-packages/bzrlib/remote.py", line 75, in _call_with_body_bytes_expecting_body
    method, args, body_bytes)
  File "/usr/lib/python2.6/dist-packages/bzrlib/smart/client.py", line 170, in call_with_body_bytes_expecting_body
    method, args, body=body, expect_response_body=True)
  File "/usr/lib/python2.6/dist-packages/bzrlib/smart/client.py", line 79, in _call_and_read_response
    readv_body=readv_body, body_stream=body_stream)
  File "/usr/lib/python2.6/dist-packages/bzrlib/smart/client.py", line 45, in _send_request
    protocol_version)
  File "/usr/lib/python2.6/dist-packages/bzrlib/smart/client.py", line 115, in _construct_protocol
    request = self._medium.get_request()
  File "/usr/lib/python2.6/dist-packages/bzrlib/smart/medium.py", line 711, in get_request
    return SmartClientStreamMediumRequest(self)
  File "/usr/lib/python2.6/dist-packages/bzrlib/smart/medium.py", line 969, in __init__
    raise errors.TooManyConcurrentRequests(self._medium)
TooManyConcurrentRequests: The medium 'SmartSSHClientMedium(bzr+ssh://<email address hidden>/)' has reached its concurrent request limit. Be sure to finish_writing and finish_reading on the currently open request.
HPSS calls: 63 (11 vfs) SmartSSHClientMedium(bzr+ssh://<email address hidden>/)

Tags: hpss ssh
Revision history for this message
Martin Pool (mbp) wrote :
Changed in bzr:
status: New → Confirmed
importance: Undecided → High
tags: added: hpss ssh
Revision history for this message
Vincent Ladeuil (vila) wrote :

Confirmed.

I encounter it with bound branches and use the following workaround:
  bzr unbind; bzr pull -v ; bzr push; bzr bind

Revision history for this message
Vincent Ladeuil (vila) wrote :

One setup:

bzr info
Repository checkout (format: 2a)
Location:
  repository checkout root: .
        checkout of branch: bzr+ssh://bazaar.launchpad.net/~vila/bzr/2.2-integration/
         shared repository: /net/bigmamac.local/Users/vila/src/bzr

Related branches:
  public branch: http://bazaar.launchpad.net/~vila/bzr/2.2-integration/
    push branch: bzr+ssh://bazaar.launchpad.net/~vila/bzr/2.2-integration/
  parent branch: bzr+ssh://bazaar.launchpad.net/~bzr-pqm/bzr/2.2
  submit branch: http://bazaar.launchpad.net/~bzr-pqm/bzr/2.2

I think the problem is the stacked-on branch being bzr+ssh://bazaar.launchpad.net/~bzr-pqm/bzr/bzr.dev

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

Other bug subscribers

Bug attachments

Remote bug watches

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