Skip to content

fix: Restart or stop sync process by connectionStatusSubject.#2595

Merged
Keith-CY merged 1 commit into
nervosnetwork:developfrom
yanguoyu:fix-connection-wrong
Mar 20, 2023
Merged

fix: Restart or stop sync process by connectionStatusSubject.#2595
Keith-CY merged 1 commit into
nervosnetwork:developfrom
yanguoyu:fix-connection-wrong

Conversation

@yanguoyu
Copy link
Copy Markdown
Contributor

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 network genesisHash has not refresh, so it will start a wrong sync process that connects the mainnet database and use the testnet data, so I remove the start and stop from ckb-runner. But after I remove the stop sync process from ckb-runner, NetworksController may delay stop the sync process because of debounceTime. We should stop the sync process right now when the ckb node is stopped otherwise the sync process may use the wrong net data. So I remove debounceTime from NetworksController otherwise the sync process may delay stopping.

Here are the pr changes

  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.

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.
@Cedar67
Copy link
Copy Markdown
Contributor

Cedar67 commented Mar 12, 2023

Magickbase/neuron-public-issues#96 (comment)

It can be reproduced very occasionally.

image

Log:
neuron_debug_1678663081451.zip

@yanguoyu
Copy link
Copy Markdown
Contributor Author

yanguoyu commented Mar 17, 2023

From the image, your pr number is 2592, but my pr number is 2595.

@Cedar67
Copy link
Copy Markdown
Contributor

Cedar67 commented Mar 19, 2023

From the image, your pr number is 2592, but my pr number is 2595.

@yanguoyu Sorry, I read it wrong branch number.
Verified and No exceptions have been found in the target branch validation. #2595

@Keith-CY Keith-CY merged commit e15772f into nervosnetwork:develop Mar 20, 2023
@yanguoyu yanguoyu deleted the fix-connection-wrong branch March 20, 2023 01:28
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.

Error occurs when switch from testnet to mainnet

4 participants