| Previous | Next |
| STATEREPOSITORY_E_LOCKED_SHAREDCACHE_TIMEOUT_EXCEEDED | STATEREPOSTORY_E_NESTED_TRANSACTION_NOT_SUPPORTED |
STATEREPOSITORY_E_SERVICE_STOP_IN_PROGRESS
Within Windows StateRepository, STATEREPOSITORY_E_SERVICE_STOP_IN_PROGRESS reports that the request arrived while the StateRepository service was stopping. Diagnosis of this result should follow the original owner and generation rather than treating the visible symptom as the cause.
Mechanism behind the code
During a this result investigation, StateRepository is infrastructure for the Windows application model. The HRESULTs expose distinctions familiar from transactional stores: optimistic concurrency, an unfinished prepared statement, database-versus-table locking, shared-cache contention, recovery, schema compatibility, corruption, and service shutdown., these are not interchangeable reasons to delete the repository.
Service stop is a lifecycle boundary: new work should be rejected while in-flight transactions and database resources drain., a caller that immediately restarts work can create a stop/start race.
The first owner to inspect is the StateRepository request, database connection, prepared statement, transaction, schema generation, or service lifecycle that rejected the operation.
High-value telemetry
| Capture | Diagnostic value |
|---|---|
| Service state and stop trigger for it. | This places the failure on the lifecycle or transaction timeline and helps test the Windows StateRepository boundary. |
| Caller request time for it. | This separates caller input from environment and service state and helps test the Windows StateRepository boundary. |
| In-flight transaction count for it. | This provides a stable comparison across retries or another machine and helps test the Windows StateRepository boundary. |
| Retry or restart owner for it. | This identifies the exact object or resource generation involved and helps test the Windows StateRepository boundary. |
Decision table
- Isolated connection against a repository copy: for it, a changed result separates retained object, connection, path, host, or device state from the original input. Hold constant: for it, preserve schema, data generation, and transaction sequence.
- Reduced failing operation: If this result follows the reduced step, the rejecting transition is localized. Hold constant: for it, retain service state and stop trigger and remove only unrelated work.
- Targeted corrective control: Use this as a diagnostic branch rather than a blanket workaround: stop issuing new requests after stop notification. Hold constant: for it, keep the original this result sample available for the final regression test.
Safe reduction procedure
When it is returned, use a disposable control object, repository copy, file, or device association where the subsystem permits it.
- First: Stop issuing new requests after stop notification.
- Next: Let in-flight work resolve according to contract.
- Then: Wait for a new service generation before retrying.
- Finally: Tag connections and requests by generation.
Do not erase the distinction
During a it investigation, STATEREPOSITORY_E_BLOCKED can occur during other internal phases; SERVICE_STOP_IN_PROGRESS is specifically teardown.
Do not force-start another service instance or reuse connections from the stopping generation.
Successful outcome
Verify it with the original scenario, one boundary case, and one deliberate failure; success means all old-generation work drains or fails deterministically and new work begins only after a confirmed start.
Technical references
The references below define the API family or storage/protocol behavior used to interpret it.
- Microsoft Win32 metadata: winerror.h
- Microsoft: Windows service guidance for StateRepository
- SQLite: File locking and concurrency
- SQLite: Result and extended result codes
Looking for a different code? Search another status or error code.