Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError on self._request_callbacks.pop(seq) #365

Closed
bantzi opened this issue Jan 16, 2020 · 3 comments
Closed

KeyError on self._request_callbacks.pop(seq) #365

bantzi opened this issue Jan 16, 2020 · 3 comments
Assignees

Comments

@bantzi
Copy link

bantzi commented Jan 16, 2020

after updating from version 3.2.3 to latest version 4.1.2
I started experiencing an internal KeyError exception

looking at the rpyc protocol.py changes

  1. it appears that pop is no longer protected by checking whether seq exists in the _request_callbacks as it was in 3.2.3

  2. also it appears that now _async_request function is also doing pop in the except block when _send raises an exception (didn't do so in version 3.2.3)
    which can trigger this problem

stack trace:

  File "/Users/abc/Library/Python/2.7/lib/python/site-packages/rpyc/core/netref.py", line 161, in __getattribute__
    return syncreq(self, consts.HANDLE_GETATTR, name)
  File "/Users/abc/Library/Python/2.7/lib/python/site-packages/rpyc/core/netref.py", line 76, in syncreq
    return conn.sync_request(handler, proxy, *args)
  File "/Users/abc/Library/Python/2.7/lib/python/site-packages/rpyc/core/protocol.py", line 464, in sync_request
    return self.async_request(handler, *args, timeout=timeout).value
  File "/Users/abc/Library/Python/2.7/lib/python/site-packages/rpyc/core/async_.py", line 100, in value
    self.wait()
  File "/Users/abc/Library/Python/2.7/lib/python/site-packages/rpyc/core/async_.py", line 47, in wait
    self._conn.serve(self._ttl)
  File "/Users/abc/Library/Python/2.7/lib/python/site-packages/rpyc/core/protocol.py", line 387, in serve
    self._dispatch(data)
  File "/Users/abc/Library/Python/2.7/lib/python/site-packages/rpyc/core/protocol.py", line 359, in _dispatch
    self._request_callbacks.pop(seq)(True, obj)
KeyError: 36

Environment
  • rpyc version = 4.1.2
  • python version = 2.7
  • operating system = Mac
@comrumino
Copy link
Collaborator

If possible, do you have a minimal test case to reproduce the issue? Either way, I'll take a look. I've been letting issues trickle in before doing another release. Thanks for reporting the issue!

@comrumino comrumino self-assigned this Jan 18, 2020
@bantzi
Copy link
Author

bantzi commented Jan 22, 2020

Hi, Thanks for the quick fix
is there any new version release coming soon?

@bantzi
Copy link
Author

bantzi commented Jan 23, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants