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

Introduce simplified sync locks that panic when poisoned #4486

Merged
merged 3 commits into from
Jan 8, 2025

Conversation

poljar
Copy link
Contributor

@poljar poljar commented Jan 8, 2025

This should help us to enable the unwrap_used clippy lint in the future.

Should be reviewed commit by commit, we first introduce the lock wrappers and then we start using them.

No functional changes.

@poljar poljar requested review from a team as code owners January 8, 2025 14:54
@poljar poljar requested review from jmartinesp and BillCarsonFr and removed request for a team January 8, 2025 14:54
Copy link
Contributor

@jmartinesp jmartinesp left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM! I guess we'll be migrating the existing lock().unwrap() and RwLock usages little by little before enabling the clippy check?

@poljar
Copy link
Contributor Author

poljar commented Jan 8, 2025

Thanks, LGTM! I guess we'll be migrating the existing lock().unwrap() and RwLock usages little by little before enabling the clippy check?

Yes. There are also a bunch of questionable unwraps that are not caused by the locks.

@poljar poljar force-pushed the poljar/simplified-locks branch from 210f373 to 6f6629b Compare January 8, 2025 17:08
@poljar poljar enabled auto-merge (rebase) January 8, 2025 17:09
@poljar poljar merged commit 62567ca into main Jan 8, 2025
39 checks passed
@poljar poljar deleted the poljar/simplified-locks branch January 8, 2025 17:59
Copy link

codecov bot commented Jan 8, 2025

Codecov Report

Attention: Patch coverage is 95.00000% with 8 lines in your changes missing coverage. Please review.

Project coverage is 85.09%. Comparing base (dc2775e) to head (6f6629b).
Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
crates/matrix-sdk-common/src/locks.rs 75.00% 4 Missing ⚠️
...trix-sdk-crypto/src/olm/group_sessions/outbound.rs 93.33% 2 Missing ⚠️
...c/session_manager/group_sessions/share_strategy.rs 50.00% 1 Missing ⚠️
crates/matrix-sdk-crypto/src/store/memorystore.rs 96.42% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4486      +/-   ##
==========================================
- Coverage   85.11%   85.09%   -0.03%     
==========================================
  Files         283      284       +1     
  Lines       31790    31804      +14     
==========================================
+ Hits        27059    27063       +4     
- Misses       4731     4741      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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