-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: beatree propagates errors during begin_sync #772
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
380ff15
to
961bf0e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find this change a tad bit convoluted!
Just consider this. We wrap begin_sync_task
in catch_unwind
which returns thread::Result
. Then we stringify/type-erase it via anyhow
. Then we coerce that into std::io::Result
with the ErrorKind::Other
! In this context, IMO, every use of Other
should be scrutinized.
Let's unwind this spaghetti (🥁).
We can pass the panic payload through the channel and then on the receiving side perform panic::resume_unwind(payload)
.
One thing is that I am not sure what will get printed upon propagating this panic. I am pretty sure the backtrace printed will originate from resume_unwind
which is useless and the one in catch_unwind
is way more valuable.
961bf0e
to
faf1d6b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new version shapes up way better. Also want to highlight that nomt/src/beatree/allocator/mod.rs got std::io::Result on some of its functions, specifically allocate
and grow
, just because I tripped on that a couple of times already.
Requires fixing up the tests.
faf1d6b
to
3f963ce
Compare
88f0f7b
to
a480fe1
Compare
3f963ce
to
17033d0
Compare
tests fixed! |
17033d0
to
b19d214
Compare
No description provided.