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

QUICStream recreated after graceful destroy #66

Closed
tegefaulkes opened this issue Oct 10, 2023 · 5 comments
Closed

QUICStream recreated after graceful destroy #66

tegefaulkes opened this issue Oct 10, 2023 · 5 comments
Assignees
Labels
development Standard development r&d:polykey:core activity 4 End to End Networking behind Consumer NAT Devices

Comments

@tegefaulkes
Copy link
Contributor

Specification

Sorry but I don't have many details here. I'll have to reproduce it in a test here.

In Polykey during one of the tests where a single RPC client call was made and ends gracefully. I noticed that a 2nd stream was created and passed to the RPCServer to be handled but it never reached the handler stage. This caused an issue where the RPCServer.stop() just hung since the stream never ended.

We've seen this problem before where the quiche stream state is not fully cleaned up after the stream has ended. In this case the stream still exists on the iterator and is re-created as a QUICStream. We need to double check if this is still a problem and make sure the streams are properly cleaned up in quiche.

To properly clean up a stream in quiche you need to attempt a write that throws if its a writable. or attempt a read that throws if it is a readable. If we don't do this the state wont transition.

Minor detail, but the stream was re-created on the client connection but I didn't see it on the server connection side.

Additional context

Tasks

  1. Check if the quiche stream state has been cleaned up properly on the client connection side for a gracefully ended stream.
  2. apply a fix if needed.
@tegefaulkes tegefaulkes added the development Standard development label Oct 10, 2023
@CMCDragonkai
Copy link
Member

I wonder if there's a check we can do when a stream being recreated like the new stream ID is below a counter. We have one-sided counter but we could also maintain the other sides counter so we know exactly when this occurs.

@CMCDragonkai
Copy link
Member

Is this still a problem and should it be considered part of the stability issues?

@tegefaulkes
Copy link
Contributor Author

I'll have to double check if this is still a problem.

@CMCDragonkai
Copy link
Member

I think we should have an exception that throws if the same stream-id is re-used. Also stream ID is always incremented.

@tegefaulkes
Copy link
Contributor Author

I had a look over it and added 3 tests. I don't see this problem happening currently and if it does with further changes the new test should catch it. I'm going to close this issue with the new commit. It doesn't warrant a PR.

@CMCDragonkai CMCDragonkai added the r&d:polykey:core activity 4 End to End Networking behind Consumer NAT Devices label Aug 13, 2024
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:core activity 4 End to End Networking behind Consumer NAT Devices
Development

No branches or pull requests

2 participants