fix: Restart or stop sync process by connectionStatusSubject.#2595
Merged
Conversation
1. Remove `debounceTime` because it has `distinctUntilChanged` unless the node connects or disconnects frequently. 2. Remove starting or stopping the sync process from `ckb-runner`, because it has control by `connectionStatusSubject`, when the `ckb` connection status changes, it will stop or start. 3. Add start and stop App logs to find the latest running log.
Keith-CY
approved these changes
Mar 2, 2023
alexsupa597
approved these changes
Mar 7, 2023
Contributor
|
Magickbase/neuron-public-issues#96 (comment) It can be reproduced very occasionally. |
Contributor
Author
|
From the image, your pr number is 2592, but my pr number is 2595. |
Contributor
Cedar67
approved these changes
Mar 19, 2023
This was referenced May 27, 2023
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This pr will fix Magickbase/neuron-public-issues#96. Here is why I changed the code like this:
When starting the sync process in
ckb-runner, the networkgenesisHashhas not refresh, so it will start a wrong sync process that connects themainnetdatabase and use thetestnetdata, so I remove the start and stop fromckb-runner. But after I remove the stop sync process fromckb-runner,NetworksControllermay delay stop the sync process because ofdebounceTime. We should stop the sync process right now when theckbnode is stopped otherwise the sync process may use the wrong net data. So I removedebounceTimefromNetworksControllerotherwise the sync process may delay stopping.Here are the pr changes
debounceTimebecause it hasdistinctUntilChangedunless the node connects or disconnects frequently.ckb-runner, because it has control byconnectionStatusSubject, when theckbconnection status changes, it will stop or start.