Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

External client ignores task hub name configuration #127

Closed
bhugot opened this issue Sep 17, 2022 · 7 comments · Fixed by #128
Closed

External client ignores task hub name configuration #127

bhugot opened this issue Sep 17, 2022 · 7 comments · Fixed by #128

Comments

@bhugot
Copy link
Contributor

bhugot commented Sep 17, 2022

Hello,
When using an external client with sql provider. the specified task hub is ignored. The only way to have the specified task hub used is actually to use this

services.Configure<DurableTaskOptions>(options =>
        {
            options .HubName = "CustomTaskHub";
        });

But it's only one taskhub that could be use this way. And we need to be able to ask for many task hub on same sql schema.
What we do is

private async Task<IReadOnlyCollection<DurableOrchestrationStatus>> SearchPerTaskHubAsync(string taskHub,
        OrchestrationStatusQueryCondition condition, CancellationToken cancellationToken)
    {
        var client = _durableClientFactory.CreateClient(new DurableClientOptions
        {
            TaskHub = taskHub // <-- this is not used
        });
        var result = new List<DurableOrchestrationStatus>();
        while (true)
        {
            var page = await client.ListInstancesAsync(condition, cancellationToken);
            result.AddRange(page.DurableOrchestrationState);
            if(string.IsNullOrEmpty(page.ContinuationToken))
                return result;
            condition.ContinuationToken = page.ContinuationToken;
        }
    }
@bhugot
Copy link
Contributor Author

bhugot commented Sep 17, 2022

I should have we activated EXECUTE dt.SetGlobalSetting @Name='TaskHubMode', @Value=0

@bhugot
Copy link
Contributor Author

bhugot commented Sep 17, 2022

Ok I think that I have found the root cause of it

it's creating another SqlOrchestrationService instead of using the one created correctly one line before so it should instead do that

SqlOrchestrationService orchestrationService = new SqlOrchestrationService(clientOptions.GetOrchestrationServiceSettings(
                    this.extensionOptions,
                    this.connectionInfoResolver));
                clientProvider = new SqlDurabilityProvider(
                    orchestrationService,
                    clientOptions);

bhugot pushed a commit to bhugot/durabletask-mssql that referenced this issue Sep 17, 2022
…sing default TestHubName or DurableTaskOption HubName instead of using the specified TaskHub
@cgillum cgillum changed the title Multiple task hub External client ignores task hub name configuration Oct 11, 2022
@bhugot
Copy link
Contributor Author

bhugot commented Oct 12, 2022

@cgillum any date for the release or is it possible to have a preview?

@cgillum
Copy link
Member

cgillum commented Oct 12, 2022

@bhugot the thing that's blocking the release is that I need to put together a suite of schema upgrade/compatibility tests now that we've reached the stable release versions. This will take some time and we don't have a date for it yet. I can get you a preview package if you're okay without it containing any database upgrade compatibility validation.

@bhugot
Copy link
Contributor Author

bhugot commented Oct 12, 2022

Would be great for the preview.

@cgillum
Copy link
Member

cgillum commented Oct 12, 2022

OK. You can find the preview nuget packages uploaded here:

@bhugot
Copy link
Contributor Author

bhugot commented Oct 12, 2022

Thanks alot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants