Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Eixt nodeos gracefully if db size is smaller than snapshot size #10936

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

softprofe
Copy link
Contributor

@softprofe softprofe commented Dec 8, 2021

Change Description

For EPE 894, if db size if set to smaller than snapshot size, it will print bad_alloc and throw. After this PR, give a meaningful print and gracefully shutdown.

Change Type

Select ONE:

  • Documentation
  • Stability bug fix
  • Other
  • Other - special case

Testing Changes

Select ANY that apply:

  • New Tests
  • Existing Tests
  • Test Framework
  • CI System
  • Other

Consensus Changes

  • Consensus Changes

API Changes

  • API Changes

Documentation Additions

  • Documentation Additions

Copy link

@plroblox plroblox left a comment

Choose a reason for hiding this comment

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

ok

Copy link
Contributor

@heifner heifner left a comment

Choose a reason for hiding this comment

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

This fix is not better it indicates success on exit.

@softprofe
Copy link
Contributor Author

This fix is not better it indicates success on exit.

After this PR, It print two red marked lines to let user know error happened. as below:
error 2021-12-08T02:34:32.713 thread-0 controller.cpp:531 startup ] db storage not configured to have enough storage for the provided snapshot, please increase and retry snapshot
error 2021-12-08T02:34:32.713 thread-0 controller.cpp:539 startup ] Failed initialization from snapshot

The final line says nodeos successfully exiting just let user know it is not crashed.
info 2021-12-08T02:34:32.715 thread-0 main.cpp:179 main ] nodeos successfully exiting

I think for most people and most company, a crashed-like end is not recommend. @nksanthosh please make decision we will have this PR or not.

@nksanthosh
Copy link
Contributor

This fix is not better it indicates success on exit.

@heifner - can you elaborate what you are suggesting here? (exit with a non zero error code? or something else?)

@matthewdarwin
Copy link

the node failed to start, so non-zero exit code seems correct here.

@heifner
Copy link
Contributor

heifner commented Dec 13, 2021

@heifner - can you elaborate what you are suggesting here? (exit with a non zero error code? or something else?)

The reported issue was that all that was reported was bad alloc. The actual error was indicated before the bad alloc error. All I think we need to do is change nodeos main.cpp catch of boost::interprocess::bad_alloc to indicate that the likely issue is chainbase exhaustion and to look for previously reported errors.

We still want nodeos to return BAD_ALLOC return code 1 in this case.

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

Successfully merging this pull request may close these issues.

None yet

5 participants