Skip to content

Use PooledConnectionLifetime with HttpClient #1223

@gabbsmo

Description

@gabbsmo

Currently SendGridClient support short-lived HttpClient instances using IHttpClientFactory. If not using that, it will internally create a singleton client.

This internal client does not have any configured PooledConnectionLifetime and as a result suffers from DNS errors when a IP adress no longer responds to api.sendgrid.com.

To use the SDK safetly in long running scenarios without ASP.NET Core Dependency Injection - PooledConnectionLifetime should be configured to match the TTL of api.sendgrid.com. From what I can tell with nslookup, that is 60 seconds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions