Skip to content

Decrypt completed sync transactions outside mNxsMutex - #358

Open
jolavillette wants to merge 1 commit into
RetroShare:masterfrom
jolavillette:fix/gxs-transaction-decrypt-nofreeze
Open

Decrypt completed sync transactions outside mNxsMutex#358
jolavillette wants to merge 1 commit into
RetroShare:masterfrom
jolavillette:fix/gxs-transaction-decrypt-nofreeze

Conversation

@jolavillette

Copy link
Copy Markdown
Contributor

processTransactions() ran processTransactionForDecryption() — per-item circle RSA decryption of completed incoming transactions — while holding mNxsMutex. On a node subscribed to circle-restricted channels this was measured at 1–3 s of RSA per sync cycle (about 225 s accumulated over a 73-minute session), blocking every other user of the service (tick, item reception, API) for the duration.

Completed transactions now leave the active map under the mutex, are decrypted after it is released — the thread is their sole owner at that point — and are queued into mComplTransactions under a brief relock. Behavior is otherwise unchanged: items whose keys are unavailable stay encrypted and are dropped at validation, as before.

🤖 Generated with Claude Code

processTransactions() ran processTransactionForDecryption() -- per-item
circle RSA decryption of completed incoming transactions -- while holding
mNxsMutex. On channels with circle-restricted groups this was measured at
1-3 s of pure RSA per sync cycle (2026 ms of a 2028 ms pass, ~225 s
accumulated over a 73-minute session), blocking every other user of the
service (tick, item reception, API) for the whole duration.

Take the completed transactions out of the active map under the mutex,
decrypt them after it is released -- the thread is their only owner at
that point -- and re-take it only to queue them into mComplTransactions.
Behavior is otherwise unchanged: processTransactionForDecryption()
replaces encrypted items in place and always returns true nowadays;
items whose keys are unavailable stay encrypted and are dropped at
validation, as before.

Co-Authored-By: Claude Fable 5 <[email protected]>
@jolavillette
jolavillette force-pushed the fix/gxs-transaction-decrypt-nofreeze branch from 5359e46 to 33ed4d6 Compare August 6, 2026 23:17
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.

1 participant