Skip to content

connection reuse issue #6

@tanimasaini

Description

@tanimasaini

Hi,

I am using this library to make multiple http calls to a particular host:port. I have configured the client to use keep alive connections and I also send Connection: keep-alive header in the http request.

public static final HttpClient client = HttpClient.builder().threadCount(32)
.setChannelOption(ChannelOption.SO_KEEPALIVE, true)
.setChannelOption(ChannelOption.SO_REUSEADDR, true)
.setChannelOption(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT)
.followRedirects().build();

However I see that the sockets opened by my application goes on increasing and connections are in established state.

If I send a header Connection: Close in the http request, the sockets are closed and reponed and hence the number of sockets in established state dont increase. This is as expected.

I think due to some reason, the client library is keeping the connection alive but is unable to reuse that connection. Is there any configuration which I am missing? Or there can be a bug in http client code or netty code?

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