Attempting connection to a scoped IPv6 address causes main thread to hang. This was discovered in the process of integrating MDNS into Polykey, where MDNS would provide valid IPv6 link-local addresses for the NodeConnectionManager to establish connections with. These addresses would look like fe80::e5ab:1462:fb26:79c%enp0s31f6. This would be passed into NodeConnectionManager.establishSingleConnection, which would call NodeConnection.createNodeConnection, which would call and await QUICClient.createQUICClient. Logging before and after this call shows that the call is made, but the Promise was never resolved. It is also indicative that it is freezing the main thread, as the nodesConnectionConnectTimeoutTime is not respected, and the Jest runner is not automatically aborting the long-running test.
This behaviour persists with any IPv6 scoped address, not just link-local addresses, such as ::1%lo. Note that specifying the scope/nic id is optional on non-link local ipv6 addresses, but still valid.
Usually routers will always assign a global IPv6 address, so IPv6 link-local addresses are meant for local network applications are can be used in absense of router. So this might be an edge case.
Describe the bug
Attempting connection to a scoped IPv6 address causes main thread to hang. This was discovered in the process of integrating MDNS into Polykey, where MDNS would provide valid IPv6 link-local addresses for the
NodeConnectionManager
to establish connections with. These addresses would look likefe80::e5ab:1462:fb26:79c%enp0s31f6
. This would be passed intoNodeConnectionManager.establishSingleConnection
, which would callNodeConnection.createNodeConnection
, which would call and awaitQUICClient.createQUICClient
. Logging before and after this call shows that the call is made, but the Promise was never resolved. It is also indicative that it is freezing the main thread, as thenodesConnectionConnectTimeoutTime
is not respected, and the Jest runner is not automatically aborting the long-running test.This behaviour persists with any IPv6 scoped address, not just link-local addresses, such as
::1%lo
. Note that specifying the scope/nic id is optional on non-link local ipv6 addresses, but still valid.Usually routers will always assign a global IPv6 address, so IPv6 link-local addresses are meant for local network applications are can be used in absense of router. So this might be an edge case.
To Reproduce
Base Case:
Proof of Thread Hanging (console.log('hi') is never ran):
Expected behavior
The
QUICClient.createQUICClient
should resolve, with aQUICConnection
to the IPv6 scoped address.Screenshots
In one case, this has caused Polykey to be aborted due to OOM.
Platform (please complete the following information)
Additional context
Notify maintainers
@tegefaulkes