Skip to content

Implement QueryOrchestrationStatesSegmentedAsync functionality in DurableTask.Emulator (LocalOrchestrationService) #1332

@solankisamir

Description

@solankisamir

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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions