You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, the Netty ChannelManager(AHC 1.9.11) seems to have an issue on tryToOfferChannelToPool.
publicfinalvoidtryToOfferChannelToPool(Channelchannel, booleankeepAlive, Stringpartition) {
if (channel.isConnected() && keepAlive && channel.isReadable()) {
LOGGER.debug("Adding key: {} for channel {}", partition, channel);
channelPool.offer(channel, partition);
if (maxConnectionsPerHostEnabled)
channelId2KeyPool.putIfAbsent(channel.getId(), partition);
Channels.setDiscard(channel);
} else {
// not offeredcloseChannel(channel);
}
}
Looks like channelPool.offer should happen after Channels.setDiscard, otherwise the channel becomes available for selection while the previous request cleanup is still happening. This will cause a "java.util.concurrent.TimeoutException: Request timed out" under certain loads.
This is the snippet I used to reproduce the issue:
slandelle
changed the title
Netty ChannelManager.tryToOfferChannelToPool makes channel available for selection prematurely
Netty ChannelManager.tryToOfferChannelToPool discard chunks after offering to pool
Mar 8, 2015
Hello, the Netty ChannelManager(AHC 1.9.11) seems to have an issue on tryToOfferChannelToPool.
Looks like channelPool.offer should happen after Channels.setDiscard, otherwise the channel becomes available for selection while the previous request cleanup is still happening. This will cause a "java.util.concurrent.TimeoutException: Request timed out" under certain loads.
This is the snippet I used to reproduce the issue:
I think the fix should be something similar to:
instead of :
The text was updated successfully, but these errors were encountered: