Skip to content

Commit 24deb70

Browse files
Netty ChannelManager.tryToOfferChannelToPool makes channel available for selection prematurely
AsyncHttpClient#834
1 parent a84e03b commit 24deb70

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

providers/netty3/src/main/java/org/asynchttpclient/providers/netty3/channel/ChannelManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,10 +284,10 @@ protected String getTargetContentEncoding(String contentEncoding) throws Excepti
284284
public final void tryToOfferChannelToPool(Channel channel, boolean keepAlive, String partition) {
285285
if (channel.isConnected() && keepAlive && channel.isReadable()) {
286286
LOGGER.debug("Adding key: {} for channel {}", partition, channel);
287+
Channels.setDiscard(channel);
287288
channelPool.offer(channel, partition);
288289
if (maxConnectionsPerHostEnabled)
289290
channelId2KeyPool.putIfAbsent(channel.getId(), partition);
290-
Channels.setDiscard(channel);
291291
} else {
292292
// not offered
293293
closeChannel(channel);

0 commit comments

Comments
 (0)