-
Notifications
You must be signed in to change notification settings - Fork 5
NodeConnectionManager
manages remote initiated connections
#527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
So the main changes that need to be made are the following
On the first point, we need to make On the 2nd point, the The 3rd point may be the trickiest. We need to handle the incoming connections and add them to the object map. This means handling a The main point of fuzziness with the design right now is how we handle the connection map locking. It would be possible for a race condition where two nodes attempt a connection to each other at the same time. Since there should only be one connection how do we decide which one to use? We will only know about an incoming connection after it has established and verified, so that should take precedence to any running connection attempt for that node. Extra care needs to be taken when handling this. |
I think this can and should be done after the agent migration work is done. Possible as a new PR, just so we have a clean point to work from. |
Wouldn't integration of js-quic lead to this in one go since agent RPC migration is already done? |
It could be done while integrating js-quic, but I think it will be better to handle this in a separate stage of changes. Remember that we want to avoid expanding the scope of issues and PRs if we can avoid it. |
Based on a discussion. The |
Order of work goes as follows.
|
Almost done here. Just need to do some clean up and fix tests. Maybe take a look at locking and connection creation and see if I can tidy it up with monitors. While working on this I was able to combine the client and server side |
This is done now. Looking into either removing UWS or fixing up vaults cloning/pulling next. |
Not in the case of PK. But in other scenarios... it may be necessary. It also depends, do both actually use the same options? |
If this is done, are you working against a PR that can close this issue or? |
I'm working out of #535 |
Uh oh!
There was an error while loading. Please reload this page.
Specification
With the creation and integration of
@matrixai/js-quic
, the concept of a connection is now generic toforward
andreverse
initiated connections. This means, no matter who initiated the connection, streams can be created in either direction.Previously the
NodeConnectionManager
only managedforward
initiated connections. Now it should be able to handle reverse connections and add them to the connection map. This is essential for re-using connections efficiently.The
NodeConnection
needs to be updated to be able to wrapQUICConnection
s coming out of theQUICServer
. This will be a new async creation method. The cleanup logic will need to switch based on if it was a forward connection with aQUICClient
or a reverse connection.The
QUICServer
needs to be moved into and managed by theNodeConnectionManager
. It's lifecycle will be fully managed. I don't know if we want to be able to DI it.Reverse connections coming out of the
QUICServer
needs to be handled, wrapped in aNodeConnection
and added into the connection map. There may be some complexities with locking here, that still needs to be prototyped.All reverse stream events coming out of the
QUICConnectons
need to be handled by theRPCServer
via a handleStream callback.Additional context
js-quic
integration and Agent migration #525Tasks
NodeConnection
to wrap reverse createdQUICStreams
and handle clean up in all cases.QUICClient
can be optional and needs to be handled.QUICServer
needs to be moved and managed byNodeConnectionManager
QUICServer
needs to be handled and put into the connection map.QUICConnection
s needs to be handled by aRPCServer
via ahandleStream
callback.The text was updated successfully, but these errors were encountered: