Skip to content

cmd/geth: propagate import error when --nocompaction is set#35152

Open
cuiweixie wants to merge 1 commit into
ethereum:masterfrom
cuiweixie:fix-geth-import-nocompaction-err
Open

cmd/geth: propagate import error when --nocompaction is set#35152
cuiweixie wants to merge 1 commit into
ethereum:masterfrom
cuiweixie:fix-geth-import-nocompaction-err

Conversation

@cuiweixie

Copy link
Copy Markdown
Contributor

importChain records the first import failure in importErr, logs it, and returns it at the end of the function so that "geth import" exits with a non-zero status on failure. However, the --nocompaction early return returned nil instead of importErr, so an import that failed while that flag was set was reported as success (exit code 0).

This silently masked import failures from any script or CI step that relies on the exit code. Return importErr from the early-return path as well, matching the normal (compacting) path.

importChain records the first import failure in importErr, logs it, and
returns it at the end of the function so that "geth import" exits with a
non-zero status on failure. However, the --nocompaction early return
returned nil instead of importErr, so an import that failed while that
flag was set was reported as success (exit code 0).

This silently masked import failures from any script or CI step that
relies on the exit code. Return importErr from the early-return path as
well, matching the normal (compacting) path.
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.

1 participant