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

Add context wrapping for syncer disconnections #2432

Merged
merged 1 commit into from
Oct 10, 2024
Merged

Conversation

jrick
Copy link
Member

@jrick jrick commented Oct 10, 2024

Any long-lived process (such as mixing) must return if the network backend (e.g. the dcrd RPC connection) is disconnected or the syncer encounters another error. However, it was observed that mixclient calls were continuing to execute despite the syncer erroring, resulting in locked outputs that could not be mixed after the syncer reconnected and restarted.

To avoid this, the network backend interface gains additional methods to select on when disconnect occurs, and a new context wrapping function is added, which creates a derived context that is canceled (or "done") after the syncer exits. Wrapped contexts are added in the ticket purchasing and account mixing paths, including those being performed by the autobuyer.

wallet/network.go Outdated Show resolved Hide resolved
spv/sync.go Outdated Show resolved Hide resolved
Copy link
Member

@davecgh davecgh left a comment

Choose a reason for hiding this comment

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

Untested, but it reads correctly now.

Any long-lived process (such as mixing) must return if the network backend
(e.g. the dcrd RPC connection) is disconnected or the syncer encounters
another error.  However, it was observed that mixclient calls were continuing
to execute despite the syncer erroring, resulting in locked outputs that could
not be mixed after the syncer reconnected and restarted.

To avoid this, the network backend interface gains additional methods to
select on when disconnect occurs, and a new context wrapping function is
added, which creates a derived context that is canceled (or "done") after the
syncer exits.  Wrapped contexts are added in the ticket purchasing and account
mixing paths, including those being performed by the autobuyer.
@jrick jrick merged commit 4adf892 into decred:master Oct 10, 2024
2 checks passed
@jrick jrick deleted the nbctx branch October 10, 2024 17:51
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