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

Restart with ctrl-c during replay of forkdb spams log #869

Closed
heifner opened this issue Oct 2, 2024 · 5 comments · Fixed by #894 or #896
Closed

Restart with ctrl-c during replay of forkdb spams log #869

heifner opened this issue Oct 2, 2024 · 5 comments · Fixed by #894 or #896
Assignees
Labels
bug The product is not working as was intended. 👍 lgtm
Milestone

Comments

@heifner
Copy link
Member

heifner commented Oct 2, 2024

info  2024-10-02T14:33:26.585 nodeos    main.cpp:172                  operator()           ] appbase quit called
info  2024-10-02T14:33:26.585 nodeos    controller.cpp:2012           operator()           ] applying branch from fork database ending with block: 17ac10c63717c83121ea88dc52dd64cc2c9223da73704ec7f5d80692336b1c29
info  2024-10-02T14:33:26.626 nodeos    main.cpp:172                  operator()           ] appbase quit called
info  2024-10-02T14:33:26.626 nodeos    controller.cpp:2012           operator()           ] applying branch from fork database ending with block: 17ac10c63717c83121ea88dc52dd64cc2c9223da73704ec7f5d80692336b1c29
info  2024-10-02T14:33:26.649 nodeos    main.cpp:172                  operator()           ] appbase quit called
info  2024-10-02T14:33:26.649 nodeos    controller.cpp:2012           operator()           ] applying branch from fork database ending with block: 17ac10c63717c83121ea88dc52dd64cc2c9223da73704ec7f5d80692336b1c29
info  2024-10-02T14:33:26.707 nodeos    main.cpp:172                  operator()           ] appbase quit called
info  2024-10-02T14:33:26.708 nodeos    controller.cpp:2012           operator()           ] applying branch from fork database ending with block: 17ac10c63717c83121ea88dc52dd64cc2c9223da73704ec7f5d80692336b1c29
info  2024-10-02T14:33:26.740 nodeos    main.cpp:172                  operator()           ] appbase quit called
info  2024-10-02T14:33:26.741 nodeos    controller.cpp:2012           operator()           ] applying branch from fork database ending with block: 17ac10c63717c83121ea88dc52dd64cc2c9223da73704ec7f5d80692336b1c29
info  2024-10-02T14:33:26.774 nodeos    main.cpp:172                  operator()           ] appbase quit called
info  2024-10-02T14:33:26.774 nodeos    controller.cpp:2012           operator()           ] applying branch from fork database ending with block: 17ac10c63717c83121ea88dc52dd64cc2c9223da73704ec7f5d80692336b1c29
info  2024-10-02T14:33:26.794 nodeos    main.cpp:172                  operator()           ] appbase quit called
info  2024-10-02T14:33:26.794 nodeos    controller.cpp:2012           operator()           ] applying branch from fork database ending with block: 17ac10c63717c83121ea88dc52dd64cc2c9223da73704ec7f5d80692336b1c29
info  2024-10-02T14:33:26.824 nodeos    main.cpp:172                  operator()           ] appbase quit called
info  2024-10-02T14:33:26.825 nodeos    controller.cpp:2012           operator()           ] applying branch from fork database ending with block: 17ac10c63717c83121ea88dc52dd64cc2c9223da73704ec7f5d80692336b1c29
info  2024-10-02T14:33:26.860 nodeos    main.cpp:172                  operator()           ] appbase quit called
info  2024-10-02T14:33:26.860 nodeos    controller.cpp:2012           operator()           ] applying branch from fork database ending with block: 17ac10c63717c83121ea88dc52dd64cc2c9223da73704ec7f5d80692336b1c29
info  2024-10-02T14:33:26.883 nodeos    main.cpp:172                  operator()           ] appbase quit called
info  2024-10-02T14:33:26.883 nodeos    controller.cpp:2012           operator()           ] applying branch from fork database ending with block: 17ac10c63717c83121ea88dc52dd64cc2c9223da73704ec7f5d80692336b1c29
...

It does finish but this should be interrupted so it exits right away instead of replaying all the blocks in the forkdb.

@arhag arhag added bug The product is not working as was intended. 👍 lgtm and removed triage labels Oct 2, 2024
@arhag arhag added this to the Spring v1.0.3 milestone Oct 2, 2024
@greg7mdp greg7mdp self-assigned this Oct 3, 2024
@greg7mdp greg7mdp moved this from Todo to In Progress in Team Backlog Oct 3, 2024
@greg7mdp
Copy link
Contributor

greg7mdp commented Oct 4, 2024

I have added a test to try to reproduce the issue, but I don't know how to get into this loop.

Whe I start from genesis with a block log and fork_db, the fork_db blocks are applied earlier here in the replay() function.

@heifner do you know what scenario would get me to that code?

@heifner
Copy link
Member Author

heifner commented Oct 4, 2024

It is easy to reproduce manually. Sync to EOS mainnet with a large sync span of say 3000. Shut down while syncing. Note a large number of blocks written to forkdb. If not repeat until you get a large number in the forkdb. Restart the node. Ctrl-c while it is replaying the forkdb.

@heifner
Copy link
Member Author

heifner commented Oct 4, 2024

We just need to check for app is_quitting in the loop that applies blocks from the forkdb. Where this log statement is at.

@heifner
Copy link
Member Author

heifner commented Oct 4, 2024

It is stuck in the loop because we do check in the maybe switch forks which exits that, but then we call it again over and over.

@greg7mdp
Copy link
Contributor

greg7mdp commented Oct 4, 2024

It is stuck in the loop because we do check in the maybe switch forks which exits that, but then we call it again over and over.

Yes, the fix is obvious. I'll just go with it I guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The product is not working as was intended. 👍 lgtm
Projects
Status: Done
4 participants