Paused instances and retries
Configure client retries while a GoodMem Cloud instance wakes
GoodMem Cloud can wake a paused instance when it receives a request. While the instance starts, the edge holds each request for up to 25 seconds. If it is still waking, the edge returns HTTP 503 with Retry-After: 15 and a wake marker. The six REST clients can wait through these responses automatically.
Retry behavior
Wake retries require all of the following:
- HTTP 503.
X-Goodmem-Activator-Wake: retry. The activator uses this marker only when it did not forward the request. It removes the marker from backend responses.- A valid
Retry-After: unsigned decimal seconds up to 9007199254740991, or an IMF-fixdate such asWed, 21 Oct 2015 07:28:00 GMT. Signed numbers, fractional numbers, loose date formats, and larger numbers are invalid. Past dates mean zero seconds. - A replayable request body.
This applies to every method, including reads, retrieval, and decision-model evaluation. There are no path exceptions. The delay is the larger of the server hint and exponential backoff of 1, 2, 4, 8, then 16 seconds. There is no jitter.
The default 180-second budget starts with the first attempt. It limits when another retry can start. Each attempt retains its normal HTTP timeout and the caller's cancellation or deadline. A final attempt can finish after 180 seconds. For example, a request started at 160 seconds can return its 503 at 185 seconds. The client then returns that HTTP error and its hint; it does not turn budget expiry into a transport timeout.
The budget is not a total call deadline. If an attempt has no finite request timeout or caller deadline, it can remain pending. Set a caller deadline when the whole operation must finish within a fixed time. No new retry starts after the wake budget. Successful bodies and streams retain their normal timeout rules and are never replayed after a stream starts.
Network errors, authentication errors, unmarked 503 responses, and errors after a successful stream begins do not trigger wake retries. An offline local server is not started by the client. A non-cloud endpoint can trigger the same retry policy only if it returns the required headers.
Configure retries
| Client | Configure wake retry starts | Disable all SDK retries |
|---|---|---|
| Python sync and async | retry=RetryPolicy(wake_timeout=180.0) | retry=None |
| TypeScript | retry: { wakeTimeoutMs: 180_000 } | retry: false |
| Go | WithRetryPolicy(goodmem.RetryPolicy{WakeTimeout: 180 * time.Second}) | WithRetryPolicy(goodmem.RetryPolicy{}) |
| Java sync and async | .retryPolicy(RetryPolicy.builder().wakeTimeout(Duration.ofSeconds(180)).build()) | .retryPolicy(RetryPolicy.none()) |
| .NET | Retry = new RetryPolicy { WakeTimeout = TimeSpan.FromSeconds(180) } | Retry = RetryPolicy.None |
| Rust | .retry_policy(RetryPolicy::default().wake_timeout(Duration::from_secs(180))) | .retry_policy(RetryPolicy::none()) |
Import RetryPolicy from the same client package as the main client. Omission uses the default policy. Set the wake field to zero to disable wake retries. Go uses DefaultRetryPolicy() to construct the default explicitly; Java uses RetryPolicy.defaults(), and .NET uses RetryPolicy.Default.
The error retains the parsed hint when retries stop or are disabled. Invalid hints are absent metadata; the original HTTP status remains available.
File uploads
| Client | File upload wake replay |
|---|---|
| Python | Streamed multipart bodies are not replayed. |
| TypeScript | Buffered FormData values can be replayed. |
| Java | Replayable in-memory and file bodies can be replayed; one-shot or duplex caller streams cannot. |
| Go | Pipe-backed multipart bodies are not replayed. |
| .NET | JSON/byte-array bodies can be replayed; streamed and multipart content is not replayed. |
| Rust | Multipart requests that reqwest cannot clone are not replayed. |
The SDK does not read a caller's upload stream merely to enable retries. For a non-replayable upload, first call a lightweight read such as system info to wait for the instance to wake. Then open the input and upload it. This reduces cold-wake failures but does not guarantee that the instance remains ready; reopen the input before an explicit retry.
MCP and Claude Code
The local MCP server inherits the TypeScript policy when built with the updated client. The Claude Code plugin's local MCP connection uses that server. A host's tool deadline can end the call earlier. The separately hosted cloud MCP gateway does not inherit the TypeScript transport.
Raw gRPC callers
The six SDKs above use REST. Applications that use protobuf stubs directly must configure their gRPC channel separately. For example, this service configuration enables retries for the read-only server-info method:
{
"methodConfig": [{
"name": [{"service": "goodmem.v1.SystemService", "method": "GetServerInfo"}],
"retryPolicy": {
"maxAttempts": 5,
"initialBackoff": "15s",
"maxBackoff": "30s",
"backoffMultiplier": 1.5,
"retryableStatusCodes": ["UNAVAILABLE"]
}
}]
}Supply this configuration through your gRPC library's channel API and set a call deadline appropriate to your application. The deadline covers the whole RPC, including retries. The activator's grpc-retry-pushback-ms controls the retry delay in implementations that support pushback. gRPC also applies its own retry limits and backoff rules; this is not the REST RetryPolicy.
An UNAVAILABLE status alone does not prove that a write was not processed. Do not apply this example to all write methods. See the gRPC retry guide for channel configuration and retry conditions.