-
Notifications
You must be signed in to change notification settings - Fork 28
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
Allow async implementation for BackupReader and BackupWriter #399
Conversation
Please make sure the following happened
|
Isn't the previous way strictly incorrect? The code running it is |
should we just remove |
IMO there's no reason to try to preserve the old (incorrect) behavior. |
we can't remove mock can't impl |
So a mock can't depend on the thing it's mocking? Weird, but I don't have time to dig into it.
Or move the trait to a separate crate, so both can depend on it. That's how |
I think we can move the new traits into the aleph-bft-types crate, that's were the other traits used in the api like Network are too. |
Hi, we have looked into your PR and into the issues in your repository, apologies for letting it hang here for a long time. We have introduced traits |
If it was to be done this way then the core alephbft async code calling this interface should be calling it wrapped in some https://docs.rs/tokio/latest/tokio/task/fn.block_in_place.html , otherwise async executor gets blocked on blocking IO operations, potentially stalling async executor. |
27dbaa3
to
bfc752b
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.
Nice, thanks! One little comment left.
Oh, and some failing checks, mostly related to version bumps, one of which should happen in the readme. |
|
maybe version checks don't understand that removing imports doesn't need bump? |
oh those were pub use but not exported at top level |
using
io::Write
orio::Read
forces a sync implementation.we were using
block_on
to use async inside the implementation, but this blocking the executor and sometimes leads to deadlocks.this is backwards compatible by implementing new traits for any
io::Read
andio::Write
impls.see fedimint/fedimint#4054 for more context.