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

capnp_rpc does not work on monoio #495

Closed
SteveLauC opened this issue May 10, 2024 · 4 comments
Closed

capnp_rpc does not work on monoio #495

SteveLauC opened this issue May 10, 2024 · 4 comments

Comments

@SteveLauC
Copy link
Contributor

Hi:)

I am playing the hello-world example on monoio (A runtime that is based on io_uring), but both server and client sides block, and from my observation, .awaiting RpcSystem won't finish and simply blocks, so I come here to seek some help:>

You can find the code here, in README, I documented the changes that I have made to the original code and some observations that I found while debugging the program, hope they will help a bit.

@dwrensha
Copy link
Member

Interesting. What happens if you try a simpler example that uses only capnp-futures (and no RPC)? Does that hit a similar problem?

@SteveLauC
Copy link
Contributor Author

SteveLauC commented May 11, 2024

Hi! Thanks for your help and response!

I wrote a simple TCP server that would echo the message received from client using capnp-futures and monoio (repo), and it looks like it is working pretty well:

$ cargo b
$ ./target/debug/capnp_futures_monoio server 127.0.0.1:8100
INFO: server listening on 127.0.0.1:8100
$ ./target/debug/capnp_futures_monoio client 127.0.0.1:8100 first_message
INFO: client message sent
INFO: client received: 'Server: copy that'
$ ./target/debug/capnp_futures_monoio server 127.0.0.1:8100
INFO: server listening on 127.0.0.1:8100
INFO: Server received: 'first_message'
INFO: Server response sent

@SteveLauC
Copy link
Contributor Author

SteveLauC commented May 27, 2024

Well, it turns out that it WORKS on monoio!

It blocks in my repo because I .awaited the RpcSystem, which should not be done, so this issue does not exist, closing.

@dwrensha
Copy link
Member

Ah, right. The RpcSystem needs to be driven, but if you await it in the main task then it will never finish. You need to spawn a new task for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants