TooManyConcurrentRequests when committing to lightweight checkout

Bug #1046284 reported by Jonathan Lange
36
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Bazaar
In Progress
Undecided
John A Meinel

Bug Description

$ bzr ci
Committing to: bzr+ssh://bazaar.launchpad.net/~canonical-ca-hackers/ca-configs/txpkgme-configmanager/
modified sourcedeps.conf
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.7/dist-packages/bzrlib/commands.py", line 930, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 1141, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 673, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 697, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/cleanup.py", line 136, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/cleanup.py", line 166, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/builtins.py", line 3688, in run
    lossy=lossy)
  File "/usr/lib/python2.7/dist-packages/bzrlib/decorators.py", line 218, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/workingtree_4.py", line 218, in commit
    result = WorkingTree.commit(self, message, revprops, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/decorators.py", line 218, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/mutabletree.py", line 211, in commit
    *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/commit.py", line 290, in commit
    lossy=lossy)
  File "/usr/lib/python2.7/dist-packages/bzrlib/cleanup.py", line 132, in run
    self.cleanups, self.func, self, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/cleanup.py", line 166, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/commit.py", line 452, in _commit
    self.builder.abort()
  File "/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.py", line 217, in abort
    self.repository.abort_write_group()
  File "/usr/lib/python2.7/dist-packages/bzrlib/remote.py", line 1212, in abort_write_group
    suppress_errors=suppress_errors)
  File "/usr/lib/python2.7/dist-packages/bzrlib/repository.py", line 282, in abort_write_group
    self._abort_write_group()
  File "/usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.py", line 1708, in _abort_write_group
    self._pack_collection._abort_write_group()
  File "/usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.py", line 1565, in _abort_write_group
    operation.run_simple()
  File "/usr/lib/python2.7/dist-packages/bzrlib/cleanup.py", line 136, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/cleanup.py", line 166, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.py", line 436, in abort
    self.upload_transport.delete(self.random_name)
  File "/usr/lib/python2.7/dist-packages/bzrlib/transport/remote.py", line 313, in delete
    resp = self._call2('delete', self._remote_path(relpath))
  File "/usr/lib/python2.7/dist-packages/bzrlib/transport/remote.py", line 181, in _call2
    return self._client.call(method, *args)
  File "/usr/lib/python2.7/dist-packages/bzrlib/smart/client.py", line 59, in call
    result, protocol = self.call_expecting_body(method, *args)
  File "/usr/lib/python2.7/dist-packages/bzrlib/smart/client.py", line 72, in call_expecting_body
    method, args, expect_response_body=True)
  File "/usr/lib/python2.7/dist-packages/bzrlib/smart/client.py", line 55, in _call_and_read_response
    return request.call_and_read_response()
  File "/usr/lib/python2.7/dist-packages/bzrlib/smart/client.py", line 157, in call_and_read_response
    return self._call(protocol_version)
  File "/usr/lib/python2.7/dist-packages/bzrlib/smart/client.py", line 189, in _call
    response_handler = self._send(protocol_version)
  File "/usr/lib/python2.7/dist-packages/bzrlib/smart/client.py", line 265, in _send
    encoder, response_handler = self._construct_protocol(protocol_version)
  File "/usr/lib/python2.7/dist-packages/bzrlib/smart/client.py", line 241, in _construct_protocol
    request = self.client._medium.get_request()
  File "/usr/lib/python2.7/dist-packages/bzrlib/smart/medium.py", line 884, in get_request
    return SmartClientStreamMediumRequest(self)
  File "/usr/lib/python2.7/dist-packages/bzrlib/smart/medium.py", line 1167, 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.

bzr 2.6.0dev3 on python 2.7.3 (Linux-3.5.0-10-generic-x86_64-with-
    Ubuntu-12.10-quantal)
arguments: ['/usr/bin/bzr', 'ci']
plugins: bash_completion[2.6.0dev3], branchdashboard[unknown],
    bzrtools[2.5.0], changelog_merge[2.6.0dev3], damage[unknown],
    difftodo[unknown], grep[0.5.0dev], launchpad[2.6.0dev3],
    netrc_credential_store[2.6.0dev3], news_merge[2.6.0dev3],
    po_merge[2.6.0dev3], pqm[1.4.0dev], stats[0.2.0dev], svn[1.2.3dev],
    weave_fmt[2.6.0dev3]
encoding: 'utf-8', fsenc: 'UTF-8', lang: 'en_GB.UTF-8'

*** Bazaar has encountered an internal error. This probably indicates a
    bug in Bazaar. You can help us fix it by filing a bug report at
        https://bugs.launchpad.net/bzr/+filebug
    including this traceback and a description of the problem.

Perhaps related to bug 1046265

Related branches

Revision history for this message
John A Meinel (jameinel) wrote :

It looks like this is a bug since bzr-2.5, so we need to fix it.
The issue is that the get_file_text code is calling list(iterator_of_iterator) but that iterator is returning a nested generator, and you are meant to consume that generator before you step the outer iterator.

Anyway, the fix is pretty straightforward, so I'll put together an updated 2.5 branch.
The only reason we saw this is because prior to 2.5 RemoteRepository didn't have an RPC implementation if iter_files_bytes, so we didn't see the lack of consuming the inner iterator.

Changed in bzr:
assignee: nobody → John A Meinel (jameinel)
status: New → In Progress
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers