grpc / grpc/grpc-rust

Long-lived streaming connections don't shut down after disconnecting from Wi-Fi on Mac

Open
#1,450 4 comments 3 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 start a server

```
Server::builder()
.add_service(SomeServer::new(SomeService())
.serve_with_shutdown(local_network_addr, async {
reload_signal.await;
})
.await
.unwrap();
```

`SomeService` implements a server-side infinitely streaming endpoint. A client requests the endpoint and consumes the stream for as long as it desires.

On server side the stream also listens for the `reload_signal`. When the stream receives the signal it ends.

The client and the server run on same wi-fi network.

When the wi-fi gets disconnected the app detects this and sends `reload_signal`, then the stream ends and the server shuts down on Linux immediately, but not on Mac. On Mac the server keeps running for about a minute and then shuts down.

I'm not sure whether this is bug, because, as far as I understand, connections must be resilient for temporary network disruptions, but on the other hand the behavior differs on Mac and Linux.

Could you please tell whether this is a bug or not and if it is not a bug then how could I achieve the same behavior on Mac as on Linux?

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.