Azure / Azure/durabletask

Implement QueryOrchestrationStatesSegmentedAsync functionality in DurableTask.Emulator (LocalOrchestrationService)

Open
#1,332 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
1.7k
Forks
335
Avg merge
2d 23h
Merged PRs (30d)
6

Description

## 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]

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.