Skip to content

mixclient: Remove submit queue channel#3401

Merged
davecgh merged 2 commits intodecred:masterfrom
jrick:nosubmitqueue
Jul 6, 2024
Merged

mixclient: Remove submit queue channel#3401
davecgh merged 2 commits intodecred:masterfrom
jrick:nosubmitqueue

Conversation

@jrick
Copy link
Member

@jrick jrick commented Jul 5, 2024

The submit queue channel was not actually increasing any performance. (*peer).submit() would synchronously wait for all error results, and the call to (*Wallet).SubmitMixMessage was already synchronized by the mixpool mutex.

Furthermore, this also fixes a deadlock that was observed after a mixing wallet with the RPC syncer mode reconnected to a restarted dcrd. Pair request messages were being submitted onto the channel with the client mutex held in (*Client).Dicemix. However, handleSubmitQueue had already exited and the client had not yet been restarted after dcrd reconnect, and was unable to be started due to the locked mutex.

The submit queue channel was not actually increasing any performance.
(*peer).submit() would synchronously wait for all error results, and the call
to (*Wallet).SubmitMixMessage was already synchronized by the mixpool mutex.

Furthermore, this also fixes a deadlock that was observed after a mixing
wallet with the RPC syncer mode reconnected to a restarted dcrd.  Pair request
messages were being submitted onto the channel with the client mutex held in
(*Client).Dicemix.  However, handleSubmitQueue had already exited and the
client had not yet been restarted after dcrd reconnect, and was unable to be
started due to the locked mutex.
The client mutex was being held during the initial publishing of pair request
messages to prevent a situation where a submit errored but the peer was still
associated with the client, or the message was submitted to mixpool and sent
to other peers but our local peer had not yet been associated to the client at
the time an epoch tick occurred.  This should not be a situation we will
encounter anymore, since the PR submissions are spaced out intentionally to
avoid sending them close to the epoch.
@davecgh davecgh added this to the 2.1.0 milestone Jul 5, 2024
@davecgh davecgh merged commit b5c58ed into decred:master Jul 6, 2024
@jrick jrick deleted the nosubmitqueue branch July 6, 2024 03:02
@davecgh davecgh modified the milestones: 2.1.0, 2.0.4 Aug 28, 2024
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