chaos

cordon and drain the server (preemption simulation)

Simulates a connection-lifecycle preemption (e.g. a Kubernetes node drain or spot reclamation). While cordoned, new exchanges are signalled to back off — by a 503 + Connection: close, an HTTP/2 GOAWAY frame, or both — while in-flight requests are allowed to drain. The simulation is server-scoped and does not stop the JVM. An empty body uses defaults (mode "both", drainMillis from stopDrainMillis, no TTL). drainMillis and ttlMillis are clamped to preemptionSimulationMaxDrainMillis.

put/mockserver/preemption

Request

  • Base URL: http://localhost:1080
  • URL: http://localhost:1080/mockserver/preemption
  • Auth: none declared

Request body

mode'reject503' | 'goaway' | 'both'

how draining is signalled: reject503 = 503 + Connection: close; goaway = HTTP/2 GOAWAY frame; both = both

drainMillisinteger

how long in-flight requests are allowed to drain; defaults to the stopDrainMillis property, clamped to preemptionSimulationMaxDrainMillis

ttlMillisinteger

auto-uncordon after this many milliseconds (dead-man's switch); 0 (default) means no auto-uncordon

lastStreamIdinteger

HTTP/2 GOAWAY last_stream_id to advertise; -1 (default) lets the server choose

Response

preemption simulation started or replaced

state'inactive' | 'draining' | 'drained'
inFlightinteger

number of requests currently in flight

drainRemainingMillisinteger

milliseconds left in the drain window

mode'reject503' | 'goaway' | 'both'

active signalling mode (omitted when inactive)

Changes

No recorded changes to this operation across all 1 revision of this API.