Skip to content

Commit 961e0f9

Browse files
committed
tryToOfferChannelToPool shouldn't mark channel as discard after offering to pool, close AsyncHttpClient#834
1 parent b166c9d commit 961e0f9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,10 +260,10 @@ protected String getTargetContentEncoding(String contentEncoding) throws Excepti
260260
public final void tryToOfferChannelToPool(Channel channel, boolean keepAlive, String partitionId) {
261261
if (channel.isActive() && keepAlive && channel.isActive()) {
262262
LOGGER.debug("Adding key: {} for channel {}", partitionId, channel);
263+
Channels.setDiscard(channel);
263264
channelPool.offer(channel, partitionId);
264265
if (maxConnectionsPerHostEnabled)
265266
channel2KeyPool.putIfAbsent(channel, partitionId);
266-
Channels.setDiscard(channel);
267267
} else {
268268
// not offered
269269
closeChannel(channel);

0 commit comments

Comments
 (0)