Problem
Currently, calling QueryOrchestrationStatesSegmentedAsync on client services that use DurableTask.Emulator (LocalOrchestrationService) results in a NullReferenceException, since the emulator does not implement the instance store query APIs. This breaks scenarios where consumers want to test or query orchestration states in-proc (e.g., for integration testing or local feature development) and depend on behavior parity with instance-backed services like AzureTableInstanceStore.
This is only specific to client using DurableTask.ServiceBus backend in production and using DurableTask.Emulator for local runs.
Expected Behavior
- The emulator should provide a (possibly in-memory) implementation of
QueryOrchestrationStatesSegmentedAsync that allows query patterns similar to those in AzureTableInstanceStore.
- Querying orchestration state in local scenarios would enable better automated tests and developer workflows without requiring a full Azure Storage/Table backend.
Actual Behavior
QueryOrchestrationStatesSegmentedAsync is not implemented and instanceStore is null, so attempting to call it results in a crash (NullReferenceException).
- This is confusing when writing code agnostic to target backend.
To Reproduce
- Use any client with
LocalOrchestrationService and call QueryOrchestrationStatesSegmentedAsync.
- Observe the crash.
Suggestions
- Implement
QueryOrchestrationStatesSegmentedAsync in the emulator so the query will enumerate in-memory orchestration state.
- At a minimum, gracefully throw NotSupportedException with a clear message instead of returning null or failing with NullReferenceException.
References
- [Issue context and analysis: https://github.com/Azure/durabletask]
- [Emulator implementation: LocalOrchestrationService.cs]
Problem
Currently, calling
QueryOrchestrationStatesSegmentedAsyncon client services that useDurableTask.Emulator(LocalOrchestrationService) results in a NullReferenceException, since the emulator does not implement the instance store query APIs. This breaks scenarios where consumers want to test or query orchestration states in-proc (e.g., for integration testing or local feature development) and depend on behavior parity with instance-backed services likeAzureTableInstanceStore.This is only specific to client using DurableTask.ServiceBus backend in production and using DurableTask.Emulator for local runs.
Expected Behavior
QueryOrchestrationStatesSegmentedAsyncthat allows query patterns similar to those inAzureTableInstanceStore.Actual Behavior
QueryOrchestrationStatesSegmentedAsyncis not implemented and instanceStore is null, so attempting to call it results in a crash (NullReferenceException).To Reproduce
LocalOrchestrationServiceand callQueryOrchestrationStatesSegmentedAsync.Suggestions
QueryOrchestrationStatesSegmentedAsyncin the emulator so the query will enumerate in-memory orchestration state.References