Go to file
Ivan Bahdanau 08b73bf914 Unhealthy channel is not offered back to the pool.
Motivation:
When releasing unhealthy channel back to a pool we don't have to offer it since on acquire it will be discarded anyways.
 Also checking healthiness at release is a good idea so we don't end up having tons of unhealthy channels in the pool(unless they became unhealthy after being offered)

Modifications:
private SimpleChannelPool.offerIfHealthy() method added that is called from SimpleChannelPool.doReleaseChannel(). SimpleChannelPool.offerIfHealthy() offers channel back to pool only if channel is healthy.
Otherwise it throws setFailure exception to the promise.

 Result:
The pool is now much cleaner and not spammed with unhealthy channels.

Added ability to choose if channel health has to be validated on release by passing boolean flag.

Motivation:
Depending on performance preferences and individual use cases sometimes we would like to be able force health check of a channel at release time and do not offer it back to the pool. Other times we would want to just release channel and offer it back to the pool and check health only when we try to acquire that channel from the pool. See more details here: https://github.com/netty/netty/issues/4077#issuecomment-130461684

Modifications:
Future<Void> release(Channel channel, Promise<Void> promise, boolean offerHealthyOnly);
The offerHealthyOnly boolean flag allows developers to choose whether to do channel validation before offering it back to pool or not.
Appropriate modifications made to hierarchy of implementations of ChannelPool. offerHealthyOnly=true will force channel health to be checked before offering back to pool. offerHealthyOnly=false  will ignore channel health check and will just try just offer it back to the pool
 offerHealthyOnly=true by default.

Result:
Channel health check before offer back to pool is controlled by a flag now.

Code changed to satisfy checkstyle requirements.

Motivation:
Code needs to satisfy checkstyle requirements.

Modifications:
 SimpleChannelPool.java:279 line split to be less then 120 characters.
 SimpleChannelPool.java:280:31 space added after '{'
 SimpleChannelPool.java:282:17 space added after '{'
 SimpleChannelPoolTest.java:198 - extra white space line removed.

Result:
Code satisfies checkstyle requirements.

 offerHealthyOnly is passed as a constructor parameter now.

Motivation:
Instead of passing offerHealthyOnly as a method parameter it is better to pass it in as SimpleChannelPool or FixedChannelPool constructor.

Modifications:
 Redundant release method that takes offerHealthyOnly removed from ChannelPool.
 offerHealthyOnly parameter added to constructor for FixedChannelPool and SimpleChannelPool.

Result:
SimpleChannelPool and FixedChannelPool are now take offerHealthyOnly as a constructor parameter. Default behavior is: offerHealthyOnly=true.

Code changed to satisfy checkstyle requirements.

Motivation:
Code needs to satisfy checkstyle requirements.

Modifications:
 SimpleChannelPool.java:84: line made to be no longer then 120 characters.
 SimpleChannelPool.java:237: extra white space line removed.

Result:
Code satisfies checkstyle requirements.

Tests do not need to be too  copled to the code. Exception message should not be validated

Motivation:
We don't need our tests to be too coupled to the code. Exception type validation in tests is just good enough.

Modifications:
Exception validation message removed from SimpleChannelPoolTest.testUnhealthyChannelIsNotOffered() test.

Result:
The SimpleChannelPoolTest test is less coupled to the code now.

Stack trace set to empty for UNHEALTHY_NON_OFFERED_TO_POOL.

Motivation:
We don't need stack trace for UNHEALTHY_NON_OFFERED_TO_POOL.

Modifications:
Added  UNHEALTHY_NON_OFFERED_TO_POOL.setStackTrace(EmptyArrays.EMPTY_STACK_TRACE) to static init block.

Result:
UNHEALTHY_NON_OFFERED_TO_POOL's stack trace set to empty.

Minor code re-factorings.

Motivation:
For better code readability we need to apply several minor code re-factorings.

Modifications:
javadocs true -> {@code true}
offerHealthyOnly variable name changed to releaseHeathCheck
<p/> -> <p> in javadocs
offerHealthyOnly removed from doReleaseChannel as it not needed there.

Result:
Code quality is improved.

Code changed to satisfy checkstyle requirements.

Motivation:
Code needs to satisfy checkstyle requirements.

Modifications:
SimpleChannelPool.java:87: line made to be no longer then 120 characters.

Result:
Code satisfies checkstyle requirements.

Pull request needs to contain only necessary changes

Motivation:
The pull request should not contain unnecessary changes that are not needed as part of required functionality of pull request.

Modifications:
private void doReleaseChannel(final Channel channel, final Promise<Void> promise) - >  private void doReleaseChannel(Channel channel, Promise<Void> promise)

Result:
Pull request contains less unnecessary modifications.
2015-08-17 15:43:08 -07:00
all [maven-release-plugin] prepare for next development iteration 2015-05-07 14:21:08 -04:00
buffer MemoryRegionCache$Entry objects are not recycled 2015-08-10 21:29:25 +02:00
codec HttpObjectAggregator doesn't check content-length header 2015-08-17 09:26:50 -07:00
codec-dns maxBytesPerRead channel configuration 2015-08-05 23:59:54 -07:00
codec-haproxy Add ProtocolDetectionResult and use it in HAProxyMessageDecoder for allow detect HAProxy protocol. 2015-06-23 08:59:07 +02:00
codec-http HttpObjectAggregator doesn't check content-length header 2015-08-17 09:26:50 -07:00
codec-http2 Headers Performance Boost and Interface Simplification 2015-08-17 08:50:11 -07:00
codec-memcache Remove Erroneous imports 2015-08-17 10:12:43 -07:00
codec-mqtt MqttEncoder build failure 2015-07-30 10:20:01 -07:00
codec-socks [maven-release-plugin] prepare for next development iteration 2015-05-07 14:21:08 -04:00
codec-stomp HttpObjectAggregator doesn't check content-length header 2015-08-17 09:26:50 -07:00
codec-xml [maven-release-plugin] prepare for next development iteration 2015-05-07 14:21:08 -04:00
common Headers Performance Boost and Interface Simplification 2015-08-17 08:50:11 -07:00
example Headers Performance Boost and Interface Simplification 2015-08-17 08:50:11 -07:00
handler Eclipse SPDY docs moved 2015-08-13 09:45:06 -07:00
handler-proxy [maven-release-plugin] prepare for next development iteration 2015-05-07 14:21:08 -04:00
license Let PoolThreadCache work even if allocation and deallocation Thread are different 2015-05-27 14:38:11 +02:00
microbench Headers Performance Boost and Interface Simplification 2015-08-17 08:50:11 -07:00
resolver [maven-release-plugin] prepare for next development iteration 2015-05-07 14:21:08 -04:00
resolver-dns DnsResolver.resolve(...) fails when ipaddress is used. 2015-07-18 17:14:05 +02:00
tarball [maven-release-plugin] prepare for next development iteration 2015-05-07 14:21:08 -04:00
testsuite Allow to create SslContext from existing PrivateKey / X509Certificate 2015-08-12 15:05:58 +02:00
testsuite-osgi Add a property to disable osgi testsuite run 2015-08-13 09:53:26 +09:00
transport Unhealthy channel is not offered back to the pool. 2015-08-17 15:43:08 -07:00
transport-native-epoll Add support for abstract domain sockets 2015-08-16 20:03:23 +02:00
transport-rxtx maxBytesPerRead channel configuration 2015-08-05 23:59:54 -07:00
transport-sctp maxBytesPerRead channel configuration 2015-08-05 23:59:54 -07:00
transport-udt maxBytesPerRead channel configuration 2015-08-05 23:59:54 -07:00
.fbprefs Updated Find Bugs configuration 2009-03-04 10:33:09 +00:00
.gitignore Add JVM crash logs to .gitignore 2014-05-18 21:36:54 +09:00
.travis.yml Travis CI branch whitelisting 2013-03-11 09:55:43 +09:00
CONTRIBUTING.md Move the pull request guide to the developer guide 2014-03-12 13:13:58 +09:00
LICENSE.txt Relicensed to Apache License v2 2009-08-28 07:15:49 +00:00
NOTICE.txt Let PoolThreadCache work even if allocation and deallocation Thread are different 2015-05-27 14:38:11 +02:00
pom.xml Upgrade jacoco-maven-plugin to the latest version 2015-08-16 19:24:50 +09:00
README.md Add a link to the 'native transports' page 2014-07-21 12:54:24 -07:00
run-example.sh Add HTTP/2 Netty tiles example 2015-05-18 14:16:54 -07:00

Netty Project

Netty is an asynchronous event-driven network application framework for rapid development of maintainable high performance protocol servers & clients.

How to build

For the detailed information about building and developing Netty, please visit the developer guide. This page only gives very basic information.

You require the following to build Netty:

Note that this is build-time requirement. JDK 5 (for 3.x) or 6 (for 4.0+) is enough to run your Netty-based application.

Branches to look

The 'master' branch is where the development of the latest major version lives on. The development of all other versions takes place in each branch whose name is identical to <majorVersion>.<minorVersion>. For example, the development of 3.9 and 4.0 resides in the branch '3.9' and the branch '4.0' respectively.