Depends on D3532
In CreateNewBackupReactor when an error occurs before the putReactor is created, there is a crash, because we try to use the putReactor in doneCallback but it's nullptr.
Differential D3533
[services] Backup - Fix premature errors crash • karol on Mar 29 2022, 4:39 AM. Authored by Tags None Referenced Files
Details Depends on D3532 In CreateNewBackupReactor when an error occurs before the putReactor is created, there is a crash, because we try to use the putReactor in doneCallback but it's nullptr. cd services yarn run-backup-service
Diff Detail
Event TimelineComment Actions In the summary you mentioned that
Which means that the code crashes because we call doneCallback in CreateNewBackupReactor after an error. I was asking if it makes sense to completely avoid calling doneCallback in that case instead of adding early return to it. Do you think it makes sense? Which solution do you prefer? Comment Actions This is against the whole idea behind the doneCallback - it should be called regardless of whether an error has been thrown or not. In this callback, we can access this->status and see if there was an error or not. Comment Actions Ok, that makes sense! Thanks for explaining it
|