-
Notifications
You must be signed in to change notification settings - Fork 8
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
feat: uid-mux #28
feat: uid-mux #28
Conversation
This is supporting work to implement a multi-threaded executor in |
Sigh, hold off on review. There is a deadlock somewhere |
It is seeming to me that |
Nope, nevermind there is a way to flush it. Fix coming soon |
@th4s @themighty1 ready! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gw!!
Some comments, potentially blocking.
Also, could you pls adjust the comments acc.to the style guide to be /// Create --> Creates etc.
I'll open a PR to add the guide to this repo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice and clean 🚀
There is one thing I do not get. There has to be some future running in order to transmit the data between client and server on existing streams. But currently it looks to me that in YamuxFuture::poll
in the end we return Poll::Pending
. So there has to be some way to wake it again, so that again data is transmitted.
But the only place we wake it, is when opening a stream (and when closing the connection). This to me sounds like data on existing streams is only transmitted when a new stream is opened or the connection is closed.
So what I mean is that yamux::Connection::poll_next_inbound
is not permanently polled.
EDIT: After some more investigation, I now suspect that it works correctly, because yamux::Connection::Active
contains a loop
in its poll
method.
Anytime a |
@th4s @themighty1 it seems my understanding of Edit: Nevermind, ChatGPT lied to me! 😂 |
There is a race condition iiuc which violates this requirement: "Note that on multiple calls to poll, only the Waker from the Context passed to the most recent call should be scheduled to receive a wakeup" Suppose that the future has just been polled and the execution is somewhere around this line tlsn-utils/uid-mux/src/yamux.rs Lines 309 to 310 in e2b207c
If around the same time the tlsn-utils/uid-mux/src/yamux.rs Line 345 in e2b207c
it will get the waker from the previous context, not from the current context as per the requirement. |
That would be fine, as the future would already be getting polled. What matters is that the waker is reset before the future returns |
Co-authored-by: dan <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ack
* feat(uid-mux): framed mux * add test utils * Apply suggestions from code review Co-authored-by: dan <[email protected]> --------- Co-authored-by: dan <[email protected]>
This PR moves/reimplements
uid-mux
in this repo.Changes
yamux
which has better flow control. This should give us higher throughput.