Skip to content
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

Feature: Monoio Runtime #1011

Closed
Miaxos opened this issue Feb 16, 2024 · 5 comments
Closed

Feature: Monoio Runtime #1011

Miaxos opened this issue Feb 16, 2024 · 5 comments
Labels
A-runtime Area: async-runtime

Comments

@Miaxos
Copy link
Contributor

Miaxos commented Feb 16, 2024

Is your feature request related to a problem? Please describe.

I want to use openraft with monoio.

Describe the solution you'd like

A feature flag with a MonoioAsyncRuntime available.

Additional context

I started a draft over this on #1010 but there are some issues:

  • is_panic & abort can be a little more complex to implement as in monoio and when you use io-uring you register to the kernel when you start reading/writing with fd. For monoio, you have to pass a Canceller. to be mapped on the operation you do on those IO to be able to have a proper cancellation.
Copy link

👋 Thanks for opening this issue!

Get help or engage by:

  • /help : to print help messages.
  • /assignme : to assign this issue to you.

@drmingdrmer
Copy link
Member

AsyncRuntime::abort() is not mandatory and can be removed:

@drmingdrmer
Copy link
Member

monoio is a little bit different about is_panic: AFAIK it's a single-threaded runtime(the future to run need no Send):

If it panics, the runtime just destroyed. There won't be any other task to examine the JoinHandle of the task in the destroyed runtime. And if send the JoinHandle to another thread(also another monoio runtime) to poll it with JoinHandle.await, there looks like to be some bug: it has chance to block forever:

Because of this issue, I can not tell what JoinHandle.await gets when the corresponding task panics.

Meanwhile, according to the API doc, monoio JoinHandle.await does not return a Result, MonoioRuntime::is_panic() could just return false.

@drmingdrmer drmingdrmer added the A-runtime Area: async-runtime label Feb 19, 2024
@SteveLauC
Copy link
Collaborator

Looks like this issue can be closed now:)

@drmingdrmer
Copy link
Member

Aye! Thank you for your great work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-runtime Area: async-runtime
Projects
None yet
Development

No branches or pull requests

3 participants