Skip to content

Commit

Permalink
remove timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelveldt committed Mar 1, 2024
1 parent ccfc3d1 commit f8a9666
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions matter_server/server/device_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import time
from typing import TYPE_CHECKING, Any, Awaitable, Callable, Iterable, TypeVar, cast

import async_timeout
from chip.ChipDeviceCtrl import DeviceProxyWrapper
from chip.clusters import Attribute, Objects as Clusters
from chip.clusters.Attribute import ValueDecodeFailure
Expand Down Expand Up @@ -63,8 +62,6 @@
DATA_KEY_NODES = "nodes"
DATA_KEY_LAST_NODE_ID = "last_node_id"

DEFAULT_CALL_TIMEOUT = 300

LOGGER = logging.getLogger(__name__)
MIN_NODE_SUBSCRIPTION_CEILING = 30
MAX_NODE_SUBSCRIPTION_CEILING = 300
Expand Down Expand Up @@ -1058,7 +1055,6 @@ async def _call_sdk(
self,
target: Callable[..., _T] | Awaitable[_T],
*args: Any,
call_timeout: int = DEFAULT_CALL_TIMEOUT,
**kwargs: Any,
) -> _T:
"""Call function on the SDK in executor and return result."""
Expand All @@ -1073,10 +1069,8 @@ async def _call_sdk(
)
# we guard all calls to the sdk with a lock because we have no good way
# of knowing if all code in the python wrapper is thread safe.
# The additional timeout is a guard to prevent ourselves from deadlocking somehow.
async with async_timeout.timeout(call_timeout):
async with self._sdk_lock:
return cast(_T, await target)
async with self._sdk_lock:
return cast(_T, await target)

async def _setup_node(self, node_id: int) -> None:
"""Handle set-up of subscriptions and interview (if needed) for known/discovered node."""
Expand Down

0 comments on commit f8a9666

Please sign in to comment.