{"action":"created","issue":{"url":"https://api.github.com/repos/Azure/azure-functions-durable-extension/issues/513","repository_url":"https://api.github.com/repos/Azure/azure-functions-durable-extension","labels_url":"https://api.github.com/repos/Azure/azure-functions-durable-extension/issues/513/labels{/name}","comments_url":"https://api.github.com/repos/Azure/azure-functions-durable-extension/issues/513/comments","events_url":"https://api.github.com/repos/Azure/azure-functions-durable-extension/issues/513/events","html_url":"https://github.com/Azure/azure-functions-durable-extension/pull/513","id":380059752,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMwMzQ4MDk1","number":513,"title":"Adding support for configuring Task Hub Name via OrchestrationClientAttribute","user":{"login":"gled4er","id":4756800,"node_id":"MDQ6VXNlcjQ3NTY4MDA=","avatar_url":"https://avatars3.githubusercontent.com/u/4756800?v=4","gravatar_id":"","url":"https://api.github.com/users/gled4er","html_url":"https://github.com/gled4er","followers_url":"https://api.github.com/users/gled4er/followers","following_url":"https://api.github.com/users/gled4er/following{/other_user}","gists_url":"https://api.github.com/users/gled4er/gists{/gist_id}","starred_url":"https://api.github.com/users/gled4er/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gled4er/subscriptions","organizations_url":"https://api.github.com/users/gled4er/orgs","repos_url":"https://api.github.com/users/gled4er/repos","events_url":"https://api.github.com/users/gled4er/events{/privacy}","received_events_url":"https://api.github.com/users/gled4er/received_events","type":"User","site_admin":false},"labels":[{"id":692833124,"node_id":"MDU6TGFiZWw2OTI4MzMxMjQ=","url":"https://api.github.com/repos/Azure/azure-functions-durable-extension/labels/full-ci","name":"full-ci","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2018-11-13T04:54:03Z","updated_at":"2018-11-21T12:41:51Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/Azure/azure-functions-durable-extension/pulls/513","html_url":"https://github.com/Azure/azure-functions-durable-extension/pull/513","diff_url":"https://github.com/Azure/azure-functions-durable-extension/pull/513.diff","patch_url":"https://github.com/Azure/azure-functions-durable-extension/pull/513.patch"},"body":"Hello @cgillum,\r\n\r\nI wanted to open this PR and start the discussion for resolving https://github.com/Azure/azure-functions-durable-extension/issues/499.\r\n\r\n\r\nThank you for the guidance for the `AutoResolve` attribute. It works as expected and it is able to resolve the value of the app setting variable. However, when using it the orchestration gets stacked in the pending state. We don't get any entries to the History table and the initial control queue message stays unprocessed. I think the runtime for some reason is trying to pull from the original task hub (configured in `host.json`) control queues. My guess is it is because the `TaskHubWorker` is initialized with the original `TaskHubName` set in `host.json` in `DurableTaskExtension.Initialize` :\r\n\r\n\r\n```csharp\r\nthis.orchestrationServiceSettings = this.GetOrchestrationServiceSettings();\r\n            this.orchestrationService = new AzureStorageOrchestrationService(this.orchestrationServiceSettings);\r\n            this.taskHubWorker = new TaskHubWorker(this.orchestrationService, this, this);\r\n            this.taskHubWorker.AddOrchestrationDispatcherMiddleware(this.OrchestrationMiddleware);\r\n```\r\n\r\nAnd when we use the new `TaskHubName` coming from the attribute we only execute the following code in `DurableTaskExtension`:\r\n\r\n```csharp\r\nprotected internal virtual DurableOrchestrationClient GetClient(OrchestrationClientAttribute attribute)\r\n        {\r\n            DurableOrchestrationClient client = this.cachedClients.GetOrAdd(\r\n                attribute,\r\n                attr =>\r\n                {\r\n                    AzureStorageOrchestrationServiceSettings settings = this.GetOrchestrationServiceSettings(attr);\r\n                    AzureStorageOrchestrationService innerClient;\r\n                    if (this.orchestrationServiceSettings != null &&\r\n                        this.orchestrationService != null &&\r\n                        string.Equals(this.orchestrationServiceSettings.TaskHubName, settings.TaskHubName, StringComparison.OrdinalIgnoreCase) &&\r\n                        string.Equals(this.orchestrationServiceSettings.StorageConnectionString, settings.StorageConnectionString, StringComparison.OrdinalIgnoreCase))\r\n                    {\r\n                        // It's important that clients use the same AzureStorageOrchestrationService instance\r\n                        // as the host when possible to ensure we any send operations can be picked up\r\n                        // immediately instead of waiting for the next queue polling interval.\r\n                        innerClient = this.orchestrationService;\r\n                    }\r\n                    else\r\n                    {\r\n                        innerClient = new AzureStorageOrchestrationService(settings);\r\n                    }\r\n                    return new DurableOrchestrationClient(innerClient, this, attr);\r\n                });\r\n            return client;\r\n        }\r\n\r\n```\r\nBut we continue to use the previous instances of the `TaskHubWorker`.\r\n\r\nI tried re-initializing the `TaskHubWorker` in the `GetClient` method but it did not help.\r\n\r\nMay I ask you to confirm my current understanding?\r\n\r\nThank you!"},"comment":{"url":"https://api.github.com/repos/Azure/azure-functions-durable-extension/issues/comments/440649189","html_url":"https://github.com/Azure/azure-functions-durable-extension/pull/513#issuecomment-440649189","issue_url":"https://api.github.com/repos/Azure/azure-functions-durable-extension/issues/513","id":440649189,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MDY0OTE4OQ==","user":{"login":"gled4er","id":4756800,"node_id":"MDQ6VXNlcjQ3NTY4MDA=","avatar_url":"https://avatars3.githubusercontent.com/u/4756800?v=4","gravatar_id":"","url":"https://api.github.com/users/gled4er","html_url":"https://github.com/gled4er","followers_url":"https://api.github.com/users/gled4er/followers","following_url":"https://api.github.com/users/gled4er/following{/other_user}","gists_url":"https://api.github.com/users/gled4er/gists{/gist_id}","starred_url":"https://api.github.com/users/gled4er/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gled4er/subscriptions","organizations_url":"https://api.github.com/users/gled4er/orgs","repos_url":"https://api.github.com/users/gled4er/repos","events_url":"https://api.github.com/users/gled4er/events{/privacy}","received_events_url":"https://api.github.com/users/gled4er/received_events","type":"User","site_admin":false},"created_at":"2018-11-21T12:41:51Z","updated_at":"2018-11-21T12:41:51Z","author_association":"COLLABORATOR","body":"Hello @cgillum,\r\n\r\nThe tests passed after slight delay.\r\n\r\nI need to push one more commit and hopefully all the tests will pass again.\r\n\r\nI will monitor and investigate otherwise.\r\n\r\nThank you!"}}
{"actor":{"display_login":"gled4er"}}