Skip to content
Permalink
Browse files

Removed _getroom_lock

This lock is a large source of contention and from what I gathered from
@ulope it is not necessary. I don't completely understanding what was
the intention of the lock since there are no commits or comments that
explain the rationale, so I'm relying on @ulope's advice to remove the
lock.
  • Loading branch information...
hackaugusto committed Nov 5, 2019
1 parent fb5ae2e commit ce968dddfa752f7ba33e6860a83616d1e1282d30
Showing with 2 additions and 3 deletions.
  1. +2 −3 raiden/network/transport/matrix/transport.py
@@ -335,7 +335,6 @@ def _http_retry_delay() -> Iterable[float]:
self._client.add_listener(self._handle_to_device_message, event_type="to_device")

self._health_lock = Semaphore()
self._getroom_lock = Semaphore()
self._account_data_lock = Semaphore()

self._message_handler: Optional[MessageHandler] = None
@@ -930,8 +929,8 @@ def _send_with_retry(self, queue_identifier: QueueIdentifier, message: Message)
retrier.enqueue(queue_identifier=queue_identifier, message=message)

def _send_raw(self, receiver_address: Address, data: str) -> None:
with self._getroom_lock:
room = self._get_room_for_address(receiver_address)
room = self._get_room_for_address(receiver_address)

if not room:
self.log.error("No room for receiver", receiver=to_checksum_address(receiver_address))
return

0 comments on commit ce968dd

Please sign in to comment.
You can’t perform that action at this time.