# rpc error: code = Unavailable desc = the server is currently shutting down

- **ID:** `go/grpc-unavailable-server-shutdown`
- **Domain:** go
- **Category:** network_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The gRPC server is in the process of graceful shutdown and is not accepting new requests.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.0 | active | — | — |
| 1.1 | active | — | — |

## Workarounds

1. **Implement retry with backoff to wait for the server to restart.** (80% success)
   ```
   for i := 0; i < 5; i++ {
    resp, err := client.SomeRPC(ctx, req)
    if err == nil { return resp }
    if status.Code(err) != codes.Unavailable { return err }
    time.Sleep(time.Duration(1<<i) * time.Second)
}
   ```
2. **Use a load balancer to redirect requests to healthy instances.** (85% success)
   ```
   Configure a load balancer that detects server health and routes traffic away from shutting down instances.
   ```

## Dead Ends

- **Retry the request immediately.** — The server is still shutting down; it may take some time to become available again. (90% fail)
- **Force the server to stop shutdown.** — Shutdown is initiated by the server; clients cannot override it. (100% fail)
