Azure/durabletask

Orchestration with an ID that already ran is not being tracked as existing

msolimanaya opened this issue · 0 comments

The state works as expected when I configure the worker with a store and service bus. If I configure the taskhub worker with the store only, the instance is not tracked and running an orchestration with the same instance ID does not get tracked as existing.

Non working example with store only:

var storageConnectionString = "UseDevelopmentStorage=true;DevelopmentStorageProxyUri=http://127.0.0.1";


var taskHubName = "TestTaskHub";
var azureStorageSettings = new AzureStorageOrchestrationServiceSettings
{
    StorageAccountDetails = new StorageAccountDetails { ConnectionString = storageConnectionString },
    TaskHubName = taskHubName,
};

var service = new AzureStorageOrchestrationService(azureStorageSettings);

   this.taskHubWorker = new TaskHubWorker(service);

Working example with store and service bus:

`   var settings = new ServiceBusOrchestrationServiceSettings();

   IOrchestrationServiceInstanceStore store = new AzureTableInstanceStore("TestTaskHub", "UseDevelopmentStorage=true;DevelopmentStorageProxyUri= http://127.0.0.1;");

   orchestrationService = new ServiceBusOrchestrationService("service bus connection string", "TestTaskHub", store, null, settings);


   taskHubWorker = new TaskHubWorker(orchestrationService);

Rest of code:

   taskHubWorker.AddTaskOrchestrations(typeof(TasksOrchestration));


   taskHubWorker.AddTaskActivities(
  typeof(FirstTask),
       typeof(SecondTask));


   await orchestrationService.CreateIfNotExistsAsync();`