matter.js
matter.js copied to clipboard
ServerNode sometimes fails to close in v13
Hi again ;-)
Another issue i am encountering on the V13 builds is that trying to close a "ServerNode" can hang indefinitely , so for example:
this.server = await ServerNode.create({....})
...add endpoints...
this.server.start();
and then later try and close it like:
await this.server?.close();
The close command will hang indefinitely and never completes. The only logs that are printed are:
12:32:12.067 [DEBUG] [nternal.client.MatterWebsocketService] - DeviceNode: Closing bridge
12:32:12.067 [TRACE] [nternal.client.MatterWebsocketService] - none: 2025-03-30 12:32:12.067 NOTICE Node *bridge-0* going offline
12:32:12.067 [TRACE] [nternal.client.MatterWebsocketService] - OccurrenceManager: Recorded event #11003: {"eventId":1,"clusterId":40,"endpointId":0,"epochTimestamp":1743363132067,"priority":2,"payload":"undefined"}
12:32:12.080 [TRACE] [nternal.client.MatterWebsocketService] - DeviceCommissioner: Commissioning mode ended, stop announcements.
12:32:12.080 [TRACE] [nternal.client.MatterWebsocketService] - MdnsServer: Expiring records instanceName: 121C84BE4A3C83BC._matterc._udp.local port: 5540 netInterface: en0
12:32:12.080 [TRACE] [nternal.client.MatterWebsocketService] - MdnsServer: Expiring records instanceName: 121C84BE4A3C83BC._matterc._udp.local port: 5540 netInterface: en1
12:32:12.080 [TRACE] [nternal.client.MatterWebsocketService] - MdnsServer: Expiring records instanceName: 121C84BE4A3C83BC._matterc._udp.local port: 5540 netInterface: en8
12:32:12.080 [TRACE] [nternal.client.MatterWebsocketService] - MdnsServer: Expiring records instanceName: 121C84BE4A3C83BC._matterc._udp.local port: 5540 netInterface: awdl0
12:32:12.080 [TRACE] [nternal.client.MatterWebsocketService] - MdnsServer: Expiring records instanceName: 121C84BE4A3C83BC._matterc._udp.local port: 5540 netInterface: llw0
12:32:12.081 [TRACE] [nternal.client.MatterWebsocketService] - MdnsServer: Expiring records instanceName: 121C84BE4A3C83BC._matterc._udp.local port: 5540 netInterface: utun0
12:32:12.081 [TRACE] [nternal.client.MatterWebsocketService] - MdnsServer: Expiring records instanceName: 121C84BE4A3C83BC._matterc._udp.local port: 5540 netInterface: utun1
12:32:12.081 [TRACE] [nternal.client.MatterWebsocketService] - MdnsServer: Expiring records instanceName: 121C84BE4A3C83BC._matterc._udp.local port: 5540 netInterface: utun2
12:32:12.081 [TRACE] [nternal.client.MatterWebsocketService] - MdnsServer: Expiring records instanceName: 121C84BE4A3C83BC._matterc._udp.local port: 5540 netInterface: utun3
12:32:12.081 [TRACE] [nternal.client.MatterWebsocketService] - MdnsServer: Expiring records instanceName: 121C84BE4A3C83BC._matterc._udp.local port: 5540 netInterface: utun4
12:32:12.081 [TRACE] [nternal.client.MatterWebsocketService] - MdnsServer: Expiring records instanceName: 121C84BE4A3C83BC._matterc._udp.local port: 5540 netInterface: utun5
12:32:12.081 [TRACE] [nternal.client.MatterWebsocketService] - MdnsServer: Expiring records instanceName: 121C84BE4A3C83BC._matterc._udp.local port: 5540 netInterface: utun6
12:32:12.081 [TRACE] [nternal.client.MatterWebsocketService] - MdnsServer: Expiring records instanceName: 121C84BE4A3C83BC._matterc._udp.local port: 5540 netInterface: utun7
12:32:12.082 [TRACE] [nternal.client.MatterWebsocketService] - MdnsServer: Expiring records instanceName: 121C84BE4A3C83BC._matterc._udp.local port: 5540 netInterface: utun8
12:32:12.082 [TRACE] [nternal.client.MatterWebsocketService] - MdnsServer: Expiring records instanceName: 121C84BE4A3C83BC._matterc._udp.local port: 5540 netInterface: utun9
12:32:12.082 [TRACE] [nternal.client.MatterWebsocketService] - MdnsServer: Expiring records instanceName: 121C84BE4A3C83BC._matterc._udp.local port: 5540 netInterface: utun10
12:32:12.082 [TRACE] [nternal.client.MatterWebsocketService] - MdnsServer: Expiring records instanceName: 121C84BE4A3C83BC._matterc._udp.local port: 5540 netInterface: utun11
12:32:12.083 [DEBUG] [nternal.client.MatterWebsocketService] - UdpMulticastServer: utun3: send EMSGSIZE ff02::fb:5353
this is on my mac, so lots of interfaces. I think this problem may have been in earlier v13 builds as well, which would explain some random lock ups i was seeing. I don't think this happens every time, or at least it may be system dependent, but i can get it to consistently hang on my mac.
My use case here is that my code often stops the bridge so it can modifying/add/remove endpoints, then start it again.