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

Duplex transport is incompatible with serve_with_incoming_shutdown #1650

Open
shradej1 opened this issue Mar 5, 2024 · 0 comments
Open

Duplex transport is incompatible with serve_with_incoming_shutdown #1650

shradej1 opened this issue Mar 5, 2024 · 0 comments

Comments

@shradej1
Copy link

shradej1 commented Mar 5, 2024

Bug Report

Version

11.0 / HEAD

Platform

Darwin (macOS Sonoma 14.2.1) kernel version 23.2.0

Description

In trying to integration test a tonic client/server, I found the "examples/src/mock" example using tokio::io::duplex as the transport channel. This worked fine, until I changed serve_with_incoming to serve_with_incoming_shutdown.

Replacing

tokio::spawn(async move {
        Server::builder()
            .add_service(GreeterServer::new(greeter))
            .serve_with_incoming(tokio_stream::once(Ok::<_, std::io::Error>(server)))
            .await
    });

with

tokio::spawn(async move {
        Server::builder()
            .add_service(GreeterServer::new(greeter))
            .serve_with_incoming_shutdown(
                tokio_stream::once(Ok::<_, std::io::Error>(server)),
                async move { std::future::pending().await },
            )
            .await
    });

in examples/src/mock/mock.rs demonstrates that the example no longer runs successfully, instead erroring with a "Client already taken" error. This was unexpected to me.

@shradej1 shradej1 changed the title Unix domain socket endpoint is incompatible with serve_with_incoming_shutdown Duplex transport is incompatible with serve_with_incoming_shutdown Mar 5, 2024
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

1 participant