mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 13:21:37 +00:00
cmd/geth: propagate import error when --nocompaction is set
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.
This commit is contained in:
parent
eea6242742
commit
8837035b57
1 changed files with 1 additions and 1 deletions
|
|
@ -420,7 +420,7 @@ func importChain(ctx *cli.Context) error {
|
|||
fmt.Printf("GC pause: %v\n\n", time.Duration(mem.PauseTotalNs))
|
||||
|
||||
if ctx.Bool(utils.NoCompactionFlag.Name) {
|
||||
return nil
|
||||
return importErr
|
||||
}
|
||||
|
||||
// Compact the entire database to more accurately measure disk io and print the stats
|
||||
|
|
|
|||
Loading…
Reference in a new issue