Exit with code 1 instead of aborting when the OSD fails to open its devices #108

Closed
koolkhel wants to merge 1 commits from koolkhel/vitastor:osd-open-error into master
Contributor

Description

Blockstore errors at startup, such as a data device that cannot be opened, escaped from the etcd callback that creates the blockstore, and configuration errors (e.g. --osd_network 10.0.0.0/99) escaped from osd_t construction. vitastor-osd then died with "terminate called after throwing std::runtime_error" and a core dump. Print the error and exit with code 1, so that a startup error can be told from a crash. Other exceptions still abort.

Tested: new tests/test_osd_open_error.sh (fails on master with "OSD exited with code 134 instead of 1"); --osd_network 10.0.0.0/99 checked by hand (134 → 1).

Contributor Name

Yury Luneff (MIND Software LLC, https://mindsw.io)

CLA

### Description Blockstore errors at startup, such as a data device that cannot be opened, escaped from the etcd callback that creates the blockstore, and configuration errors (e.g. `--osd_network 10.0.0.0/99`) escaped from `osd_t` construction. vitastor-osd then died with "terminate called after throwing std::runtime_error" and a core dump. Print the error and exit with code 1, so that a startup error can be told from a crash. Other exceptions still abort. Tested: new `tests/test_osd_open_error.sh` (fails on master with "OSD exited with code 134 instead of 1"); `--osd_network 10.0.0.0/99` checked by hand (134 → 1). ### Contributor Name Yury Luneff (MIND Software LLC, https://mindsw.io) ### CLA - [x] I accept Vitastor CLA agreement: https://git.yourcmc.ru/vitalif/vitastor/src/branch/master/CLA-en.md
koolkhel added 1 commit 2026-10-26 21:08:20 +03:00
Blockstore errors at startup, such as a data device that cannot be opened,
escaped from the etcd callback that creates the blockstore, and configuration
errors escaped from osd_t construction. vitastor-osd then died with
"terminate called after throwing std::runtime_error" and a core dump. Print
the error and exit with code 1, so that a startup error can be told from a
crash. Other exceptions still abort.
Owner

Замержил без теста

Замержил без теста
vitalif closed this pull request 2026-10-27 23:56:13 +03:00

Pull request closed

Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: vitalif/vitastor#108
No description provided.