matrix-rust-sdk
refactor(send queue): use a specialized mutex for locking access to the state store and `being_sent`
#4268
Merged

refactor(send queue): use a specialized mutex for locking access to the state store and `being_sent` #4268

bnjbvr merged 1 commit into main from bnjbvr/being-sent-plus-store2
bnjbvr
bnjbvr189 days ago

There was an implicit relationship that the being_sent lock needed to be taken in order to do non-atomic state store operations. With the change from this commit, the relationship is now more explicit: to get a handle to the state store, or being_sent, you have to obtain a StoreLockGuard by locking against the store itself. The WeakClient isn't stored in the QueueStorage data structure itself, so it's the only way to get a dyn StateStore from the QueueStorage.

bnjbvr bnjbvr requested a review 189 days ago
bnjbvr bnjbvr removed review request 189 days ago
bnjbvr bnjbvr requested a review from Hywan Hywan 189 days ago
codecov
codecov189 days ago (edited 185 days ago)

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.02%. Comparing base (a8a83c3) to head (01ed8ad).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4268      +/-   ##
==========================================
- Coverage   85.03%   85.02%   -0.01%     
==========================================
  Files         274      274              
  Lines       30028    30039      +11     
==========================================
+ Hits        25533    25541       +8     
- Misses       4495     4498       +3     

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

bnjbvr refactor(send queue): use a specialized mutex for locking access to t…
01ed8ade
bnjbvr bnjbvr force pushed from 473d03dd to 01ed8ade 185 days ago
Hywan
Hywan approved these changes on 2024-11-18
Hywan185 days ago

LGTM!

crates/matrix-sdk/src/send_queue.rs
11371180 thumbnail: Option<(FinishUploadThumbnailInfo, MediaRequestParameters, Mime)>,
11381181 ) -> Result<(), RoomSendQueueStorageError> {
1139 // Keep the lock until we're done touching the storage.
1140
// TODO refactor to make the relationship between being_sent and the store more
Hywan185 days ago

👍

bnjbvr bnjbvr enabled auto-merge (rebase) 185 days ago
bnjbvr bnjbvr merged f1a442ba into main 185 days ago
bnjbvr bnjbvr deleted the bnjbvr/being-sent-plus-store2 branch 185 days ago

Login to write a write a comment.

Login via GitHub

Reviewers
Assignees
No one assigned
Labels
Milestone