-
Notifications
You must be signed in to change notification settings - Fork 27
wip/transport: Make accept async to close the gap on service races #525
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Alexandru Vasile <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
| // /// Start running event loop of [`WebRtcConnection`]. | ||
| // pub async fn run(mut self) { | ||
| // tracing::trace!( | ||
| // target: LOG_TARGET, | ||
| // peer = ?self.peer, | ||
| // "start webrtc connection event loop", | ||
| // ); | ||
|
|
||
| // let _ = self | ||
| // .protocol_set | ||
| // .report_connection_established(self.peer, self.endpoint.clone()) | ||
| // .await; | ||
|
|
||
| // self.run_event_loop().await; | ||
| // } | ||
|
|
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.
| // /// Start running event loop of [`WebRtcConnection`]. | |
| // pub async fn run(mut self) { | |
| // tracing::trace!( | |
| // target: LOG_TARGET, | |
| // peer = ?self.peer, | |
| // "start webrtc connection event loop", | |
| // ); | |
| // let _ = self | |
| // .protocol_set | |
| // .report_connection_established(self.peer, self.endpoint.clone()) | |
| // .await; | |
| // self.run_event_loop().await; | |
| // } |
| pub async fn next(&mut self) -> Option<TransportEvent> { | ||
| loop { | ||
| // First, check if we have a pending accept future to poll | ||
| if let Some((peer, endpoint, mut future)) = self.pending_accept.take() { |
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.
So we "stop" here everything when one connection is waiting for its accept to finish?
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.
Yep, this is not ok, especially under load. The PR is entirely vibed as PoC for @tdimitrov 🙏
I'll need to rewrite this with some FuturesUnordered and see ask Tsvetomir for another testing round 🙏
No description provided.