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

Optimize sleep_now for TokioTaskManager #4350

Merged
merged 3 commits into from
Dec 13, 2023
Merged

Conversation

xuanyuan300
Copy link
Contributor

Description

Currently, the sleep_now method in VirtualTaskManager is used in many places, such as socket. I found that according to the current sleep_now, after the task execution is completed, since the timeout task is just recv future, the sleep task that actually executes the timeout cannot be really canceling, this may cause tasks not being recycled immediately, so it will bring some potential resource issues.
This pr optimizes sleep_now and uses AbortHandle to abort the timeout task when dropping.

Signed-off-by: xuanyuan300 <[email protected]>
Signed-off-by: xuanyuan300 <[email protected]>
Copy link
Contributor

@theduke theduke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense.

We would want some additional improvements to reduce the overhead here, but this is a good fix, thanks!

@theduke theduke merged commit 32e1537 into wasmerio:master Dec 13, 2023
52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants