When minio shuts down and cancels the global context, it returns HTTP 499 instead of 503
Expected Behavior
During shutdown, when the global context is cancelled, instead of sending HTTP 499 code, the server should return HTTP 503 Service Unavailable (or some standard error code which is retry-able in the S3 SDKs).
Current Behavior
The server returns HTTP 499 (Client Closed Request) - which is semantically the opposite, since the server is shutting down and closing the connection in this case.
This makes sense if the client actually closed the connection but it would be nice to separate the graceful shutdown from this case.
Possible Solution
(Maybe) Update context cancellation / server shutdown handling to respond with a HTTP 503 during shutdown, see: https://github.com/minio/minio/blob/be7800c8136eadff2ba012412dd6c2e5fdcb548a/cmd/api-errors.go#L2256
This should not be a client side error^
Steps to Reproduce (for bugs)
- Shutting down the minio server while it processes a request results in HTTP 499 Status with the error:
1. Start a MinIO server.
2. Connect a client using an official AWS SDK (e.g. PyArrow / AWS SDK for C++) with the standard retry strategy enabled.
3. Start a long-running read request in a loop (e.g. listing objects repeatedly).
4. Stop the server to initiate a graceful shutdown.
Clients (without retrying) crash with AWS Error UNKNOWN (HTTP status 499): Client disconnected before response was ready.
Context
Since 499s are not retryable errors, this means when the minio server is shutting down (could be right before restarting as well) - clients fail without performing any retries since it is not in the error codes which are supported in the retry strategy in the AWS S3 C++ SDK (this affects PyArrow users as well).
Regression
No
Your Environment
- Version used (
minio --version):
minio version RELEASE.2025-09-07T16-13-09Z
Runtime: go1.24.6 linux/amd64
License: GNU AGPLv3 - https://www.gnu.org/licenses/agpl-3.0.html
Copyright: 2015-2025 MinIO, Inc.
- Operating System and version (
uname -a):
Linux 5.14.0-427.20.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC
Source: minio/minio