[db] move panic handling from goroutine to the parent function#1153
[db] move panic handling from goroutine to the parent function#1153ahrtr merged 1 commit intoetcd-io:mainfrom
Conversation
685b55e to
b0c50f2
Compare
ac5e2a7 to
cb454cb
Compare
cb454cb to
5030853
Compare
rdner
left a comment
There was a problem hiding this comment.
LGTM if we're going to keep the panic behavior.
But is it even necessary to panic here at all?
Why can't we handle it as an error and propagate it to the consumer letting them to decide what to do with it? Panic seems to be overkill from my point of view.
|
/ok-to-test |
|
Please also add a changelog item in this PR under https://github.com/etcd-io/bbolt/blob/main/CHANGELOG/CHANGELOG-1.5.md |
|
@ahrtr Done! 😄 |
1b4d5d5 to
9f4d8fc
Compare
|
can you please squash/merge the first two commits? |
Signed-off-by: VihasMakwana <121151420+VihasMakwana@users.noreply.github.com>
9f4d8fc to
b191c99
Compare
|
@ahrtr Done! |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ahrtr, rdner, VihasMakwana The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What does this PR do?
Previously, we listened on
echinside a goroutine and triggered a panic if an error was received. Since the panic occurred within the goroutine, it cannot be recovered by the parent function by design.This PR changes the flow as follows:
recursivelyCheckBucketin a goroutineThis way, the panic happens outside the goroutine and can be recovered.
Testing
Tested following program with a corrupted DB file and
recover()works as expectedreceiver_filelog_.tgz
Issues
Closes #1011