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

Socket exhaustion #42

Open
misteam opened this issue Jun 14, 2023 · 0 comments
Open

Socket exhaustion #42

misteam opened this issue Jun 14, 2023 · 0 comments

Comments

@misteam
Copy link

misteam commented Jun 14, 2023

There doesn't seem to be any way to dispose of the Snowflake Client once the operation is completed. Having embedded snowflake operations seems to lead to socket exhaustion.

System.IO.IOException: 'Unable to read data from the transport connection: The I/O operation has been aborted because of either a thread exit or an application request..'
Inner Exception:
SocketException: The I/O operation has been aborted because of either a thread exit or an application request.

Example:


            SnowflakeClient snowflakeClient = new SnowflakeClient(this.userName, this.password, this.account);

            var dbResults = await snowflakeClient.QueryAsync<MyObject>(sql: sqlQuery);
        
            List<MyObject> myObjects= new List<MyObject>();
            Parallel.ForEach(dbResults,async myObject=>
            {
                myObject.Address = await this.GetMyObjectAddressAsync(myObject.Id);
                myObject.Phones = await this.GetMyObjectPhoneNumbersAsync(myObject.Id);
                myObject.Emails = await this.GetMyObjectEmailAddressesAsync(myObject.Id);
                myObject.Employer = await this.GetMyObjectEmployerAsync(myObject.Id);
                myObject.Status = await this.GetMyObjectStatusAsync(myObject.Id);
                myObject.Tags = await this.GetMyObjectTagsAsync(myObject.Id);

                myObjects.Add(myObject);
            });
            return myObjects;


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

1 participant