examples/graceful-stop/README.md
This example demonstrates the intended shutdown behavior after the gRPC graceful-stop patch.
go run ./examples/graceful-stop
Typical output:
long RPC is running; starting shutdown
new RPC rejected after shutdown began: ...
long RPC completed: slept for 1500ms
done
There may be a small race window where the first post-stop RPC is still accepted once before subsequent new RPCs are rejected. The important part is that in-flight RPCs are drained while new RPCs are cut off.
go test ./server/grpc -run TestGracefulStopRejectsNewRPCsButAllowsInFlightRPCs -v
go-micro; it is unrelated to this change