Implementation:Ray project Ray Serve Shutdown
Appearance
| Knowledge Sources | |
|---|---|
| Domains | Model_Serving, Resource_Management |
| Last Updated | 2026-02-13 17:00 GMT |
Overview
Concrete tool for gracefully shutting down the Ray Serve infrastructure provided by the Ray Java Serve SDK.
Description
Serve.shutdown() sends a graceful_shutdown RPC to the Python Serve controller (30-second default timeout), then nullifies Serve.globalClient. It gracefully handles RayActorException (controller already dead) and RayTimeoutException (controller unresponsive).
Usage
Call Serve.shutdown() when the serving application is done. Ensure all requests are completed before calling.
Code Reference
Source Location
- Repository: ray-project/ray
- File: java/serve/src/main/java/io/ray/serve/api/Serve.java (L390-410)
- File: java/serve/src/main/java/io/ray/serve/api/ServeControllerClient.java (L114-136)
Signature
public static void shutdown()
Import
import io.ray.serve.api.Serve;
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| (none) | — | — | Zero-argument method |
Outputs
| Name | Type | Description |
|---|---|---|
| (side effect) | void | All replicas terminated, controller stopped, Serve.globalClient set to null |
Usage Examples
Shutdown Serve
import io.ray.serve.api.Serve;
// After all requests are complete
Serve.shutdown();
Related Pages
Implements Principle
Requires Environment
Uses Heuristic
Page Connections
Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment