-
Notifications
You must be signed in to change notification settings - Fork 172
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
fix: tokio v1.27 #1062
Merged
Merged
fix: tokio v1.27 #1062
Changes from 4 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
8ec0ab3
fix: tokio v1.27
niklasad1 b30dd44
Update server/src/transport/ws.rs
niklasad1 f29593f
fix rustdoc
niklasad1 2d8f787
Merge remote-tracking branch 'origin/na-fix-tokio-v1.27' into na-fix-…
niklasad1 3de56a1
Update server/src/transport/ws.rs
niklasad1 47db597
Update server/src/transport/ws.rs
niklasad1 1e2174e
no more futuredriver for incoming conns
niklasad1 36eb0a4
Merge remote-tracking branch 'origin/na-fix-tokio-v1.27' into na-fix-…
niklasad1 0635db3
add comment for unclear code
niklasad1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
IIUC we relied on this to make sure that we wake up:
To remove
tokio::time::Interval
we are polling theFutureDriver
alongside other operations that we do in the server:soketto::Pong
,soketto::Data
, andsoketto::Closed
Could we still get in a situation where we have no other competing tasks to drive the
FutureDriver
?(ie, we don't have
soketto::Pong
to wake us up -- or is configured at 100seconds -- and we don't receivesoketto::Data
)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.
After convincing myself that this DriverSelect thing (ie
select_with
) will poll the futures in itself as needed, maybe I'm missing something but why does it matter if this thing doesn't wake up for a while if none of the futures in it need to progress?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.
I was concerned that the
FutureDriver
will not be polled on time to handle aReady
future from its internal vector. Meaning that if we don't get enough traction from thetry_recv
, we previously made sure to have some progress with thetokio::Interval
.I was trying to imagine the unlikely scenario where
soketto::recv
fromtry_recv
won't generate events for 10 minutes, but our futures from the driver are all ready. In this case, thetokio::Interval
was making sure to advance things a bit sooner.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.
My current understanding is now that when any of those internal futures makes progress, the driver task will be polled again (or whatever task contains the
Driverselect
, anyway) and they will all re-run. So, no futures in this list should be ignored, basically. If an internal item isReady
, then it'll have calledwake()
to make everything get polled again.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, that's a good question/observation but I found that quite unlikely because both batch and calls are executed as one future/task.
Then in each loop iteration both
try_recv
andwait_for_permit
are awaited on which checks "the future vec" but it could be possible to spawn huge futures and then "never send some data again/backpressure kicks in" then those would never woken up again but I don't see it as an issue because it's up to the client enforce that.If it's idle fine but we could have a few ready tasks in the future vec.