Fix vitastor-cli osd-tree crash when the etcd request fails #100
Reference in New Issue
Block a user
No description provided.
Delete Branch "koolkhel/vitastor:cli-osd-tree-etcd-error"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
load_osd_tree() stored the etcd error, but loop() still called
format_tree() which dereferenced the placement tree that was never
built, so osd-tree and ls-osd died with SIGSEGV. Return the error
instead.
Tested: no automated test, the test harness cannot fail just this one etcd request. Reproduced with a failure-injecting HTTP proxy in front of etcd: osd-tree and ls-osd exit with 139 (SIGSEGV) before the fix and print the etcd error with EIO after it.
Contributor Name
Yury Luneff (MIND Software LLC, https://mindsw.io)
CLA