Skip to content
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

Update Nodes domain to used timedCancellable #465

Closed
tegefaulkes opened this issue Sep 29, 2022 · 5 comments · Fixed by #475
Closed

Update Nodes domain to used timedCancellable #465

tegefaulkes opened this issue Sep 29, 2022 · 5 comments · Fixed by #475
Assignees
Labels
development Standard development r&d:polykey:supporting activity Supporting core activity

Comments

@tegefaulkes
Copy link
Contributor

Specification

The nodes domain manages the agent-agent communications between nodes. This is mostly done inside of NodeConnection and NodeConnectionManager but the NodeManager wraps some of this as well. All of these needs to be reviewed and updated to make use of the TimedCancellable decorator.

Additional context

Tasks

  1. Where needed the nodes methods need to be updated to support cancellability.
  2. where needed the nodes methods need to use the timedCancellable decorator.
  3. parts of the code making use of these timedCancellable methods needs to be updated to exploit this new functionality.
  4. Tests need to be expanded to test a wide range of timeout and cancellation conditions.
@tegefaulkes tegefaulkes added the development Standard development label Sep 29, 2022
@tegefaulkes tegefaulkes self-assigned this Sep 29, 2022
@tegefaulkes
Copy link
Contributor Author

This was mostly addressed in #445 . It just needs further review and possibly test updates.

@CMCDragonkai
Copy link
Member

Regarding 4.

There are several layers of the nodes tests.

Unit-level tests on the nodes domain can make use of mocking for simple testing.

But more complex testing can be moved into the integration tests... and that relates to moving the integration tests into its own directory.

When you're reviewing the nodes tests, can you take note of any tests can be moved around, so that tests/nodes is more lighter weight, but also more flexible so we can apply fast check to them.

I suspect mocking will be required there.

@tegefaulkes
Copy link
Contributor Author

NodeConnectionManager.withConnG is a generator but still needs to take the ctx: ContextTimed because it could establish a new connection. I don't think the decorators support generators yet. Right now i'm just optionally taking the the context and just passing that along.

I'm not sure if there's a better way for this.

@tegefaulkes
Copy link
Contributor Author

The NodeConnectionManager has a dynamic parameter for setting the connection timeouts connConnectTime. but not all of the timedCancellable methods has a corresponding timeout parameter to use. pingNode should have it's own timeout parameter in the NodeConnectionManager.

The NodeManager wraps some methods from the NodeConnectionManager in it's own timedCancellable methods. They should dynamically get the timeout value as well but it doesn't seem right to set them in the NodeManager. I'll make it take the values from the NodeConnectionManager as well.

@tegefaulkes
Copy link
Contributor Author

NAT tests are still failing, that will have to be looked at next.

@CMCDragonkai CMCDragonkai added the r&d:polykey:supporting activity Supporting core activity label Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development Standard development r&d:polykey:supporting activity Supporting core activity
Development

Successfully merging a pull request may close this issue.

2 participants