Skip to content

Commit 9ad2f39

Browse files
authored
Remove (pointless) resolve lock (#486)
1 parent fa56a2f commit 9ad2f39

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

matter_server/server/device_controller.py

+13-17
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ def __init__(
9191
self.wifi_credentials_set: bool = False
9292
self.thread_credentials_set: bool = False
9393
self.compressed_fabric_id: int | None = None
94-
self._resolve_lock: asyncio.Lock = asyncio.Lock()
9594
self._node_lock: dict[int, asyncio.Lock] = {}
9695

9796
async def initialize(self) -> None:
@@ -938,22 +937,19 @@ async def _resolve_node(
938937
if self.chip_controller is None:
939938
raise RuntimeError("Device Controller not initialized.")
940939
try:
941-
# the sdk crashes when multiple resolves happen at the same time
942-
# guard simultane resolves with a lock.
943-
async with self._resolve_lock:
944-
LOGGER.log(
945-
log_level,
946-
"Attempting to resolve node %s... (attempt %s of %s)",
947-
node_id,
948-
attempt,
949-
retries,
950-
)
951-
return await self._call_sdk(
952-
self.chip_controller.GetConnectedDeviceSync,
953-
nodeid=node_id,
954-
allowPASE=False,
955-
timeoutMs=None,
956-
)
940+
LOGGER.log(
941+
log_level,
942+
"Attempting to resolve node %s... (attempt %s of %s)",
943+
node_id,
944+
attempt,
945+
retries,
946+
)
947+
return await self._call_sdk(
948+
self.chip_controller.GetConnectedDeviceSync,
949+
nodeid=node_id,
950+
allowPASE=False,
951+
timeoutMs=None,
952+
)
957953
except (ChipStackError, TimeoutError) as err:
958954
if attempt >= retries:
959955
# when we're out of retries, raise NodeNotResolving

0 commit comments

Comments
 (0)