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
Don't auto-advance time when a spawn_blocking task is running. #5115
Commits on Nov 16, 2022
-
Don't auto-advance time when a spawn_blocking task is running.
Time shouldn't auto-advance unless there's really nothing else going on. In general that is hard to fix, but this special case is relatively easy. Fixes: tokio-rs#4614
Configuration menu - View commit details
-
Copy full SHA for 6d16ce1 - Browse repository at this point
Copy the full SHA 6d16ce1View commit details -
spawn_blocking: Re-enable auto-advance if the task panics.
This uses a destructor, so it will also work if tokio machinery panics while trying to e.g. spawn a thread.
Configuration menu - View commit details
-
Copy full SHA for 282236f - Browse repository at this point
Copy the full SHA 282236fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 53053f9 - Browse repository at this point
Copy the full SHA 53053f9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0474462 - Browse repository at this point
Copy the full SHA 0474462View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5887558 - Browse repository at this point
Copy the full SHA 5887558View commit details -
Configuration menu - View commit details
-
Copy full SHA for d62c616 - Browse repository at this point
Copy the full SHA d62c616View commit details -
Attempt to fix race condition with blocking tasks and paused time.
The auto-advance inhibit count must be decremented after the blocking task is finished, and crucially after waking the JoinHandle, to prevent the tokio thread from auto-advancing before tasks awaiting that JoinHandle are rescheduled.
Configuration menu - View commit details
-
Copy full SHA for 0e6f71b - Browse repository at this point
Copy the full SHA 0e6f71bView commit details -
Configuration menu - View commit details
-
Copy full SHA for b8aee57 - Browse repository at this point
Copy the full SHA b8aee57View commit details -
Configuration menu - View commit details
-
Copy full SHA for 895bd52 - Browse repository at this point
Copy the full SHA 895bd52View commit details -
Fix race when main thread is parked as auto-advance is re-enabled.
Specifically, when a blocking task is spawned, but no thread immediately awaits the JoinHandle, if the main thread parks itself, we previously failed to unpark it when the blocking task completed. Auto-advance would be re-enabled but could not happen, a potential deadlock.
Configuration menu - View commit details
-
Copy full SHA for 4ec397e - Browse repository at this point
Copy the full SHA 4ec397eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9c1bee9 - Browse repository at this point
Copy the full SHA 9c1bee9View commit details -
Configuration menu - View commit details
-
Copy full SHA for f84b6b4 - Browse repository at this point
Copy the full SHA f84b6b4View commit details -
BlockingSchedule::new: Avoid calling Handle::current().
It does not always work; and is it happens, the caller has a handle already and can just pass it in.
Configuration menu - View commit details
-
Copy full SHA for 9ebd9ee - Browse repository at this point
Copy the full SHA 9ebd9eeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 939841f - Browse repository at this point
Copy the full SHA 939841fView commit details
Commits on Dec 1, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 2de8eef - Browse repository at this point
Copy the full SHA 2de8eefView commit details
Commits on Dec 2, 2022
-
Configuration menu - View commit details
-
Copy full SHA for a044bc6 - Browse repository at this point
Copy the full SHA a044bc6View commit details
Commits on Dec 14, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 5241fa3 - Browse repository at this point
Copy the full SHA 5241fa3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1104a8b - Browse repository at this point
Copy the full SHA 1104a8bView commit details