Skip to content

Commit

Permalink
Removed _recvlock acquire/release from sync request; while it makes i…
Browse files Browse the repository at this point in the history
…t significantly more likely that the sync request response goes to the correct thread, calling acquire/release here seems to cause a dead lock in some cases like that provided in #492; ultimately RPyC requires the design around threading and locks to be fleshed out... quite a number of users get confused w/ RPyC threading... RPyC offers a number of functions/classes that are temperamental w/ threading
  • Loading branch information
comrumino committed Jul 2, 2022
1 parent ff8f626 commit c4f0616
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions rpyc/core/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,9 +480,7 @@ def sync_request(self, handler, *args): # serving
# AsyncResult will be constructed and it is possible GIL switches
# threads before AsyncResult.wait is invoked. So, using an rlock
# we acquire once here and once inside of wait which invokes serve
self._recvlock.acquire()
value = self.async_request(handler, *args, timeout=timeout).value
self._recvlock.release()
return value

def _async_request(self, handler, args=(), callback=(lambda a, b: None)): # serving
Expand Down

0 comments on commit c4f0616

Please sign in to comment.