@@ -1293,55 +1293,14 @@ async def _setup_node_try_once(
1293
1293
) -> None :
1294
1294
"""Handle set-up of subscriptions and interview (if needed) for known/discovered node."""
1295
1295
node_data = self ._nodes [node_id ]
1296
- log_timers : dict [int , asyncio .TimerHandle ] = {}
1297
1296
is_thread_node = (
1298
1297
node_data .attributes .get (ROUTING_ROLE_ATTRIBUTE_PATH ) is not None
1299
1298
)
1300
1299
1301
- async def log_node_long_setup (time_start : float ) -> None :
1302
- """Temporary measure to track a locked-up SDK issue in some (special) circumstances."""
1303
- time_mins = int ((time .time () - time_start ) / 60 )
1304
- # get productlabel or modelname from raw attributes
1305
- node_model = node_data .attributes .get (
1306
- "0/40/14" , node_data .attributes .get ("0/40/3" , "" )
1307
- )
1308
- node_name = f"Node { node_id } ({ node_model } )"
1309
- # get current IP the sdk is using to communicate with the device
1310
- if sdk_ip_info := await self ._chip_device_controller .get_address_and_port (
1311
- node_id
1312
- ):
1313
- ip_address = sdk_ip_info [0 ]
1314
- else :
1315
- ip_address = "unknown"
1316
-
1317
- node_logger .error (
1318
- f"\n \n ATTENTION: { node_name } did not complete setup in { time_mins } minutes.\n " # noqa: G004
1319
- "This is an indication of a (connectivity) issue with this device. \n "
1320
- f"IP-address in use for this device: { ip_address } \n "
1321
- "Try powercycling this device and/or relocate it closer to a Border Router or \n "
1322
- "WiFi Access Point. If this issue persists, please create an issue report on \n "
1323
- "the Matter channel of the Home Assistant Discord server or on Github:\n "
1324
- "https://github.com/home-assistant/core/issues/new?assignees=&labels="
1325
- "integration%3A%20matter&projects=&template=bug_report.yml\n " ,
1326
- )
1327
- # reschedule itself
1328
- log_timers [node_id ] = self ._loop .call_later (
1329
- 15 * 60 , lambda : asyncio .create_task (log_node_long_setup (time_start ))
1330
- )
1331
- # release semaphore to give an additional free slot for setup
1332
- # otherwise no thread nodes will be setup if 5 are stuck in this state
1333
- if is_thread_node :
1334
- self ._thread_node_setup_throttle .release ()
1335
-
1336
1300
# use semaphore for thread based devices to (somewhat)
1337
1301
# throttle the traffic that setup/initial subscription generates
1338
1302
if is_thread_node :
1339
1303
await self ._thread_node_setup_throttle .acquire ()
1340
- time_start = time .time ()
1341
- # we want to track nodes that take too long so we log it when we detect that
1342
- log_timers [node_id ] = self ._loop .call_later (
1343
- 15 * 60 , lambda : asyncio .create_task (log_node_long_setup (time_start ))
1344
- )
1345
1304
1346
1305
try :
1347
1306
node_logger .info ("Setting-up node..." )
@@ -1397,7 +1356,6 @@ async def log_node_long_setup(time_start: float) -> None:
1397
1356
self ._polled_attributes [node_id ] = polled_attributes
1398
1357
self ._schedule_custom_attributes_poller ()
1399
1358
finally :
1400
- log_timers [node_id ].cancel ()
1401
1359
if is_thread_node :
1402
1360
self ._thread_node_setup_throttle .release ()
1403
1361
0 commit comments