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

Client State notifyWhenStateChanged values #11840

Open
tcronis opened this issue Jan 17, 2025 · 1 comment
Open

Client State notifyWhenStateChanged values #11840

tcronis opened this issue Jan 17, 2025 · 1 comment
Labels

Comments

@tcronis
Copy link

tcronis commented Jan 17, 2025

gRPC version: v1.68.1

When should the client expect to see a value of SHUTDOWN when watching the channel's state changes?

I've noticed an unexpected behavior where the client prints out the state changes of the connection, when the server is attempting to gracefully shutdown. The client will see IDLE, CONNECTING, and then TRANSIENT_FAILURE after the server has initiated a graceful shutdown.

To reproduce the behavior, I've setup a simple server and client with a bidirectional stream between them. After the RPC is opened, the server will call shutdown() and the client's runnable will print out the state changes. I was hoping to see SHUTDOWN as one of the states, but that appears to only occur when the client initiates a shutdown on the channel, not the server.

@kannanjgithub
Copy link
Contributor

What you are seeing is the expected behavior. To see the client channel state show SHUTDOWN, you can call ManagedChannel.shutdown().

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

No branches or pull requests

2 participants