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

Hub connection re-opens automatically after dispose called #677

Closed
lbargery opened this issue Oct 7, 2019 · 1 comment
Closed

Hub connection re-opens automatically after dispose called #677

lbargery opened this issue Oct 7, 2019 · 1 comment

Comments

@lbargery
Copy link

lbargery commented Oct 7, 2019

I'm using the management SDK to call my hub from a functions project. The code effectively looks like this with the appropriate connection string and hub name.

public static class MyFunction
    {
        [FunctionName("MyFunction")]
        public static async Task Run([TimerTrigger("0 */10 * * * *")]TimerInfo myTimer, ILogger log, ExecutionContext executionContext)
        {
            var connectionString = "";

            var serviceManager = new ServiceManagerBuilder()
                .WithOptions(option =>
                {
                    option.ServiceTransportType = ServiceTransportType.Persistent;
                    option.ConnectionString = connectionString;
                })
                .Build();

            var hub = await serviceManager.CreateHubContextAsync("myhub");

            await hub.DisposeAsync();
        }
    }

When I use the persistent transport type, I can see server connections leaking on Azure. When I drill into an individual transaction I see that immediately after the dispose is called and the transport stopped, it opens again,

image

I also see this behaviour locally with the above code.

@wanlwanl
Copy link
Member

Thanks. I'm trouble shooting

wanlwanl added a commit that referenced this issue Oct 11, 2019
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

No branches or pull requests

2 participants