Skip to content

Commit

Permalink
Do not override the timeout of the operational node discovery (#458)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelveldt committed Dec 7, 2023
1 parent 60a8544 commit 7b4f8f8
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions matter_server/server/device_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -932,15 +932,17 @@ async def _resolve_node(
# the sdk crashes when multiple resolves happen at the same time
# guard simultane resolves with a lock.
async with node_lock, self._resolve_lock:
LOGGER.debug("Attempting to resolve node %s...", node_id)
LOGGER.debug(
"Attempting to resolve node %s... (attempt %s of %s)",
node_id,
attempt,
retries,
)
await self._call_sdk(
self.chip_controller.GetConnectedDeviceSync,
allowPASE=False,
# For the first attempts we use the SDK's default timeout.
# Once we keep retrying we try the final attempt(s)
# with an extended timeout.
timeoutMs=30000 if attempt >= 3 else None,
nodeid=node_id,
allowPASE=False,
timeoutMs=None,
)
except (ChipStackError, TimeoutError) as err:
if attempt >= retries:
Expand Down

0 comments on commit 7b4f8f8

Please sign in to comment.