{"record":{"id":"86fd0561aaa24f6c","repo":"nats-io/nats-server","slug":"timeout-waiting-for-service-to-go-to-state-d","errorCode":null,"errorMessage":"timeout waiting for service to go to state=%d","messagePattern":"timeout waiting for service to go to state=(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/signal_windows.go","lineNumber":100,"sourceCode":"\tcase CommandReload:\n\t\tcmd = svc.ParamChange\n\t\tto = svc.Running\n\tcase commandLDMode:\n\t\tcmd = ldmCmd\n\t\tto = svc.Running\n\tdefault:\n\t\treturn fmt.Errorf(\"unknown signal %q\", command)\n\t}\n\n\tstatus, err := s.Control(cmd)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could not send control=%d: %v\", cmd, err)\n\t}\n\n\ttimeout := time.Now().Add(10 * time.Second)\n\tfor status.State != to {\n\t\tif timeout.Before(time.Now()) {\n\t\t\treturn fmt.Errorf(\"timeout waiting for service to go to state=%d\", to)\n\t\t}\n\t\ttime.Sleep(300 * time.Millisecond)\n\t\tstatus, err = s.Query()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"could not retrieve service status: %v\", err)\n\t\t}\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":82,"sourceCodeEnd":111,"githubUrl":"https://github.com/nats-io/nats-server/blob/3a66a489d262bf89b71a71c955c94920394532f3/server/signal_windows.go#L82-L111","documentation":"Windows ProcessSignal: after s.Control succeeded, the service did not reach the expected state (Stopped or Running) within the 10-second deadline despite 300ms polling. Indicates a slow or hung service — e.g. a stop that blocks on open connections or a reload that stalls.","triggerScenarios":"Thrown at server/signal_windows.go:100 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the service's own logs to see why the transition stalled","Increase available time by reducing load (open client connections) before stopping","Force-kill the process if a clean stop is impossible: taskkill /F"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3a66a489d262bf89b71a71c955c94920394532f3","analyzedAt":"2026-09-02T04:41:54.247Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}