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

txSyncer: service does not start after node catching up #4768

Merged

Conversation

algonautshant
Copy link
Contributor

@algonautshant algonautshant commented Nov 8, 2022

The txHandler and txSyncer are stopped when catching up from a catchpoint, and started again afterwards.

But they never really restart. The main loop of these services rely on a context to stop. That context is canceled when stopping. Then, when the services are started again, the contexts remain canceled, which leads for the service to immediately end.

The fix is to create a new context when starting these services.

txSync has another control mechanism to wait for before starting the loop, which should also be reset at (re)start.

This PR fixes the txSyncer part of #4775

@codecov
Copy link

codecov bot commented Nov 8, 2022

Codecov Report

Merging #4768 (6e778d7) into master (6acbd18) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #4768      +/-   ##
==========================================
- Coverage   54.69%   54.68%   -0.02%     
==========================================
  Files         416      416              
  Lines       53685    53684       -1     
==========================================
- Hits        29364    29358       -6     
- Misses      21894    21900       +6     
+ Partials     2427     2426       -1     
Impacted Files Coverage Δ
catchup/service.go 68.96% <100.00%> (+0.32%) ⬆️
rpcs/txSyncer.go 73.58% <100.00%> (-0.97%) ⬇️
network/wsPeer.go 67.06% <0.00%> (-4.30%) ⬇️
agreement/cryptoVerifier.go 67.60% <0.00%> (-2.12%) ⬇️
agreement/proposalManager.go 96.07% <0.00%> (-1.97%) ⬇️
network/wsNetwork.go 66.99% <0.00%> (-0.18%) ⬇️
ledger/accountdb.go 72.66% <0.00%> (+0.15%) ⬆️
ledger/acctonline.go 78.64% <0.00%> (+0.52%) ⬆️
ledger/blockqueue.go 85.63% <0.00%> (+1.14%) ⬆️
... and 1 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@algonautshant algonautshant changed the title Failing test: txHandler done after catchup Bug: txHandler and txSync do not start after node catching up #4775 Nov 9, 2022
@algonautshant algonautshant changed the title Bug: txHandler and txSync do not start after node catching up #4775 Bug: txSync does not start after node catching up #4775 Nov 15, 2022
@algonautshant algonautshant changed the title Bug: txSync does not start after node catching up #4775 Bug: txSyncer does not start after node catching up #4775 Nov 15, 2022
@algonautshant algonautshant added bug Something isn't working Team Carbon-11 labels Nov 15, 2022
@algonautshant algonautshant changed the title Bug: txSyncer does not start after node catching up #4775 Bug-Fix: txSyncer does not start after node catching up #4775 Nov 15, 2022
@algonautshant algonautshant added Bug-Fix and removed bug Something isn't working labels Nov 15, 2022
@algonautshant algonautshant marked this pull request as ready for review November 17, 2022 16:04
Copy link
Contributor

@brianolson brianolson left a comment

Choose a reason for hiding this comment

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

same pattern txHandler and txSyncer, eh?

catchup/service.go Outdated Show resolved Hide resolved
@algonautshant
Copy link
Contributor Author

The txHandler and txSync are fixed in separate PRs with separate tests to make sure each one is fixed and tested separately before putting them together.
The fix for any of txHandler and txSync can mask the other one.
The test for txHandler fix will fail with txSync alone, and the test for txSync will fail with txHandler fix alone.

brianolson
brianolson previously approved these changes Nov 17, 2022
@algorandskiy algorandskiy changed the title Bug-Fix: txSyncer does not start after node catching up #4775 txSyncer: service does not start after node catching up Nov 18, 2022
algorandskiy
algorandskiy previously approved these changes Nov 18, 2022
Copy link
Contributor

@algorandskiy algorandskiy left a comment

Choose a reason for hiding this comment

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

Closes #4775

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants