Skip to content

🙉How can OkHttp's connection pool detect DNS changes for existing connections? KeepAlive strategy is ineffective under continuous requests. #9218

@wynhfy

Description

@wynhfy

When using OkHttp’s connection pool, if the DNS resolution of a target domain changes , how can existing established connections be made aware of and respond to these changes?
OkHttp only performs DNS resolution when opening a new connection.Existing connections in the pool continue to send requests to the old IP address as long as they are kept alive and not idle.If there is a steady flow of requests, connections never become idle, so keepAlive settings (maximum idle duration) have no effect on cleaning up these stale connections.

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