-
-
Notifications
You must be signed in to change notification settings - Fork 123
perf(signal): coalesce receive flushes and persist outbound state pre-wire #1022
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
Changes from 13 commits
62ff07f
f2d0212
430b221
1693785
a75cfc4
4e1a851
47b33d5
b46e161
4e3e736
7be4107
4d1b8fa
6549dcd
fea31e0
9cf00c5
10a06db
14b9cac
8a38d46
4b6522c
935c83c
ef1cf76
63fe36b
1b476b7
43561b8
d6b2997
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1552,7 +1552,12 @@ impl Client { | |
| // Warm marking is visible; a waiting cold send may now re-resolve. | ||
| drop(distribution_guard); | ||
|
|
||
| // Flush cached Signal state to DB after encryption | ||
| // Flush the outbound ratchet advance synchronously before returning: | ||
| // a coalesced flush here would let send_message report success while | ||
| // the counter/chain-key advance is still only in memory, so a crash | ||
| // before the flush would reuse the counter (and its message key + IV) | ||
| // on the next send. Only the receive path — where a lost advance | ||
| // re-derives forward — coalesces. | ||
| self.flush_signal_cache_batch_safe_logged("send_message_impl", None) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P1: A send awaited from an (Based on your team's feedback about guarding Signal-state settling under the processing permit.) Prompt for AI agents
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This deadlock is real but pre-existing, not introduced here: origin/main's send epilogue already awaits There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're right — this isn't a regression from this PR. The deadlock risk comes from the existing This comment was influenced by this learning. Open the link to edit it, or reply here to edit or delete it. |
||
| .await; | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.