@@ -94,7 +94,10 @@ const WATCH_POLL_MAX_BACKOFF: Duration = Duration::from_secs(30);
9494// request a bounded opportunity to mark the control exit intentional before
9595// publishing a fail-closed runtime error.
9696const SUPERVISOR_INTENTIONAL_SHUTDOWN_GRACE : Duration = Duration :: from_secs ( 1 ) ;
97- const SUPERVISOR_HEALTH_INTERVAL_NS : i64 = 250_000_000 ;
97+ const SUPERVISOR_HEALTH_INTERVAL_NS : i64 = 30_000_000_000 ;
98+ // Docker probes at this interval only before the first healthy result and
99+ // within the start period.
100+ const SUPERVISOR_HEALTH_START_INTERVAL_NS : i64 = 250_000_000 ;
98101const SUPERVISOR_HEALTH_TIMEOUT_NS : i64 = 2_000_000_000 ;
99102const SUPERVISOR_HEALTH_START_PERIOD_NS : i64 = 60_000_000_000 ;
100103const HOST_GATEWAY_RESOLUTION_TIMEOUT : Duration = Duration :: from_secs ( 30 ) ;
@@ -5127,6 +5130,23 @@ fn docker_auxiliary_container_labels(
51275130 ] )
51285131}
51295132
5133+ fn docker_supervisor_healthcheck ( ) -> HealthConfig {
5134+ HealthConfig {
5135+ test : Some ( vec ! [
5136+ "CMD" . to_string( ) ,
5137+ SUPERVISOR_IMAGE_CONTROL_BINARY_PATH . to_string( ) ,
5138+ "health" . to_string( ) ,
5139+ "--socket" . to_string( ) ,
5140+ SUPERVISOR_HEALTH_SOCKET_PATH . to_string( ) ,
5141+ ] ) ,
5142+ interval : Some ( SUPERVISOR_HEALTH_INTERVAL_NS ) ,
5143+ timeout : Some ( SUPERVISOR_HEALTH_TIMEOUT_NS ) ,
5144+ retries : Some ( 3 ) ,
5145+ start_period : Some ( SUPERVISOR_HEALTH_START_PERIOD_NS ) ,
5146+ start_interval : Some ( SUPERVISOR_HEALTH_START_INTERVAL_NS ) ,
5147+ }
5148+ }
5149+
51305150fn docker_supervisor_host_config (
51315151 mounts : Vec < Mount > ,
51325152 grpc_endpoint : & str ,
@@ -5375,20 +5395,7 @@ async fn spawn_docker_control_process(
53755395 cmd : Some ( command) ,
53765396 env : Some ( environment) ,
53775397 labels : Some ( labels) ,
5378- healthcheck : Some ( HealthConfig {
5379- test : Some ( vec ! [
5380- "CMD" . to_string( ) ,
5381- SUPERVISOR_IMAGE_CONTROL_BINARY_PATH . to_string( ) ,
5382- "health" . to_string( ) ,
5383- "--socket" . to_string( ) ,
5384- SUPERVISOR_HEALTH_SOCKET_PATH . to_string( ) ,
5385- ] ) ,
5386- interval : Some ( SUPERVISOR_HEALTH_INTERVAL_NS ) ,
5387- timeout : Some ( SUPERVISOR_HEALTH_TIMEOUT_NS ) ,
5388- retries : Some ( 3 ) ,
5389- start_period : Some ( SUPERVISOR_HEALTH_START_PERIOD_NS ) ,
5390- start_interval : Some ( SUPERVISOR_HEALTH_INTERVAL_NS ) ,
5391- } ) ,
5398+ healthcheck : Some ( docker_supervisor_healthcheck ( ) ) ,
53925399 host_config : Some ( docker_supervisor_host_config (
53935400 supervisor_mounts,
53945401 & supervisor_endpoint,
0 commit comments