grpc / grpc/grpc-rust

transport endpoint connect hangs

Open
#1,161 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
12.5k
Forks
1.3k
Avg merge
4d 7h
Merged PRs (30d)
24

Description

I am trying to build rpc server and client. I have noticed that the generated code given below hangs while connecting on first line of the method.


```
pub async fn connect(dst: D) -> Result
where
D: std::convert::TryInto,
D::Error: Into,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
log::debug!("connected");
Ok(Self::new(conn))
}

```
trace logs show something like this

2022-11-26T05:46:59.703825Z TRACE tonic::transport::service::reconnect: poll_ready; idle
2022-11-26T05:46:59.703935Z TRACE tonic::transport::service::reconnect: poll_ready; connecting
2022-11-26T05:46:59.704053Z TRACE hyper::client::connect::http: Http::connect; scheme=Some("http"), host=Some("[::1]"), port=Some(Port(50001))
2022-11-26T05:46:59.704221Z DEBUG hyper::client::connect::http: connecting to [::1]:50001

I am listening to the server using "[::1]:50000" and the client is using url http://[::1]:50000 to connect same as given in hello world example. Both client and server run in tokio::spawn async threads.

What could be the reason that connect method hangs? Appreciate any pointers regarding this. Thanks in advance.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.