| Previous | Next |
| ERROR_INVALID_RUNLEVEL_SETTING | ERROR_RUNLEVEL_SWITCH_AGENT_TIMEOUT |
ERROR_RUNLEVEL_SWITCH_TIMEOUT
Services exceeded the run-level switch deadline
ERROR_RUNLEVEL_SWITCH_TIMEOUT is Windows system result 15402 (0x00003C2A). One or more services failed to reach their requested state before the overall timeout.
This result concerns service progress. The orchestrator needs the last checkpoint, wait hint, control request, and process state for each unfinished service rather than only the global elapsed time.
Where this value belongs
- A coordinated switch stops services before lowering the active level.
- Services are restarted while raising the level.
- One service blocks in shutdown, initialization, or dependency cleanup.
A timeout does not prove that no service changed state. The transition may be partial, so automatic replay can issue duplicate controls or start services in the wrong order.
Common interpretation mistakes
- It is mishandled when the global timeout is increased without diagnosing the stalled service.
- It is mishandled when checkpoint and wait-hint progress are not recorded.
- It is mishandled when a service process exits but its state remains pending.
- It is mishandled when partial completion is ignored before retry.
Troubleshooting steps
- Capture the deadline and elapsed time.
- List every service still STOP_PENDING or START_PENDING.
- Record checkpoints, wait hints, process IDs, and last progress times.
- Collect a dump or stack from the first stalled service when safe.
- Check dependency cleanup and control-handler logs.
- Reconcile all service states before another switch.
Useful evidence
- Preserve transition deadline and elapsed time.
- Preserve unfinished services and requested states.
- Preserve checkpoints, wait hints, and process IDs.
- Preserve service control and application logs.
- Preserve dump or trace of the first stalled process.
A per-service progress timeline distinguishes a genuinely slow operation from a deadlocked or unresponsive service.
Correct handling and recovery
Fix the blocking service, dependency, or control-handler path and choose a timeout based on measured supported behavior.
Retry after the stalled service is repaired and partial state is reconciled. Increasing the deadline alone is justified only when evidence shows steady progress.
Difference from nearby values
ERROR_RUNLEVEL_SWITCH_AGENT_TIMEOUT is about an orchestration agent that did not answer. Code 15402 is about services that did not stop or restart within the switch deadline.
Practical scenario
A database service remains STOP_PENDING with an unchanged checkpoint while flushing a corrupted log. The orchestrator returns 15402; a service dump identifies the blocked flush, which is repaired before the switch is resumed.
Implementation guidance
Track progress per service and escalate an unchanged checkpoint earlier than the global deadline. Service authors should implement bounded control handlers and accurate wait hints.
For code 15402, record runlevel_timeout_service, runlevel_timeout_checkpoint, runlevel_timeout_wait_hint, runlevel_timeout_pid, and runlevel_timeout_elapsed_ms.
References
Looking for a different code? Search another status or error code.
