Skip to content

Socket exhaustion #42

Open
Open
@misteam

Description

@misteam

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;


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions