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

[1.0 -> main] Improve finalizer safety file exception handling #663

Merged
merged 5 commits into from
Aug 28, 2024

Conversation

heifner
Copy link
Member

@heifner heifner commented Aug 28, 2024

  • Modify save_finalizer_safety_info() to never throw, but instead to log and return false.
    • Do not send out or incorporate vote if unable to save the safety file.
  • When loading finalizer safety file on producer_plugin startup fail and shutdown nodeos if unable to open the safety.dat file. See example exception message below.
  • bls_signature can throw on invalid signature. Not exactly sure if that is possible in maybe_vote, but seems like if the private key is invalid somehow it might be possible. Added a try-catch-log-and-drop so an exception there does not kill the thread pool.
  • Add missing mutex. Not really needed as set_default_safety_information() is only called at startup or during initial transition to savanna when no votes should be flowing. But doesn't hurt and easier to have it than to prove it is not needed.

Example error when unable to open safety.dat file.

debug 2024-08-28T01:11:29.039 nodeos    chain_plugin.cpp:1172         plugin_shutdown      ] exit shutdown
info  2024-08-28T01:11:29.039 nodeos    main.cpp:172                  operator()           ] appbase quit called
...
error 2024-08-28T01:11:29.040 nodeos    main.cpp:224                  main                 ] 13 NSt8ios_base7failureB5cxx11E: cfile unable to open: safety.dat in mode: rb+: iostream error
cfile unable to open: safety.dat in mode: rb+: iostream error: unable to open finalizer safety persistence file /home/heifner/ext/spring/cmake-build-debug/TestLogs/disaster_recovery13174/node_00/finalizers/safety.dat
    {"p":"/home/heifner/ext/spring/cmake-build-debug/TestLogs/disaster_recovery13174/node_00/finalizers/safety.dat","what":"cfile unable to open: safety.dat in mode: rb+: iostream error"}
    nodeos  finalizer.cpp:283 load_finalizer_safety_info

    {}
    nodeos  producer_plugin.cpp:1556 plugin_startup

Merges release/1.0 into main including #659

#646 appears to have been resolved by #624. This PR is addressing better exception handling related to #646.
Resolves #646

…t and incorporate vote if save_finalizer_safety_info() returns true.

Add missing mutex. Unlikely needed as only accessed during startup or initial transition.
Throw exception out of load_finalizer_safety_info() if unable to open file.
[1.0] Improve finalizer safety file exception handling
@heifner heifner added the OCI Work exclusive to OCI team label Aug 28, 2024
@heifner heifner merged commit 4b76e91 into main Aug 28, 2024
36 checks passed
@heifner heifner deleted the GH-646-safety-file-exceptions-main branch August 28, 2024 15:47
@ericpassmore
Copy link
Contributor

Note:start
group: STABILITY
category: INTERNALS
summary: Updates to improve management of backing file for finalizer safety information.
Note:end

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

Successfully merging this pull request may close these issues.

safety.dat unable to SEEK_SET to 0
4 participants