-
Notifications
You must be signed in to change notification settings - Fork 275
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
Add Extensions with_lock() to try and avoid timing issues #5360
Conversation
We hit a lot of problems with timing that causes flaky tests because it's not always easy to know when the compiler drops the Extensions lock. We can side-step this a lot of the time by introducing (and using) a with_lock() function.
This comment has been minimized.
This comment has been minimized.
CI performance tests
|
Only review this commit if you are very interested in the details.
In the comments for lock()
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.
great idea, thanks
We hit a lot of problems with timing that causes flaky tests because it's not always easy to know when the compiler drops the Extensions lock. We can side-step this a lot of the time by introducing (and using) a with_lock() function.
/// See related clippy lint for examples: <https://rust-lang.github.io/rust-clippy/master/index.html#/await_holding_lock> | ||
#[deprecated] |
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.
Q: Is there a reason we don't use the Deprecated macro's parameters on things like this here? Doesn't that provide a better user experience?:
#[deprecated(since = "1.49.0", note = "Users should instead use with_lock")]
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.
It definitely renders nicer in the documentation!
We hit a lot of problems with timing that causes flaky tests because it's not always easy to know when the compiler drops the Extensions lock.
We can side-step this a lot of the time by introducing (and using) a with_lock() function.
Review Notes: This commit (a0963c4) contains many changes as I replace
lock()
withwith_lock()
over the entire code base and marklock()
deprecated
. You should review the preceding commits to understand the change and then the referenced commit if you want to see the remaining changes that I made.Checklist
Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.
Exceptions
The code change is so small/simple, no tests are required.
Notes
Footnotes
It may be appropriate to bring upcoming changes to the attention of other (impacted) groups. Please endeavour to do this before seeking PR approval. The mechanism for doing this will vary considerably, so use your judgement as to how and when to do this. ↩
Configuration is an important part of many changes. Where applicable please try to document configuration examples. ↩
Tick whichever testing boxes are applicable. If you are adding Manual Tests, please document the manual testing (extensively) in the Exceptions. ↩