Netty Changelog

What's new in Netty 4.1.7

Jan 27, 2017
  • OpenSSLContext Mutual Auth does not announce acceptable CAs (#6145)
  • Ensure ReferenceCountedOpenSslEngine not swallow the close_notify (#6189)
  • ByteBufUtil.compare int underflow (#6198)
  • Potential endless loop in Recycler.Stack.scavengeSome (#6153)
  • Ensure we use a MPMC queue in ThreadDeathWatcher as it may be used from multiple threads at the same time (#6149)
  • NIO ServerChannel shouldn't close because of Exception (#6107)
  • Regression: SSL session contains extraneous NULL entries in peer certificate chain (#6098)
  • Ensure alert is send when SSLException happens during calling SslHandler.unwrap(...) (#6047)
  • Use the correct alert depending on the CertificateException when using OpenSslEngine (#6046)
  • Adding ability to get Peer Creds on a UnixDomainSocket (#5940)
  • Reduce lock contention in resource leak (#5934)
  • Correct handle HttpMessage that is EOF terminated (#5957)
  • Fix unbalanced quotes in Bundle-NativeCode manifest header(#5949)
  • Fix false-positives when using ResourceLeakDetector (#6103)
  • DefaultHttp2Connection modifying child map while iterating (#6197)
  • Fix DefaultChannelId MAC address parsing bug (#6147)
  • Do not limit the PID to be

New in Netty 4.1.6 (Oct 17, 2016)

  • Highlights:
  • Correctly throw IndexOutOfBoundsException when dst.remaining() is too big (#5878)
  • Update Default Cipher List (#5906)
  • Ensure removal of SslHandler not produce IllegalReferenceCountException (#5880)
  • Ensure we not close NioDatagramChannel when SocketException is received (#5899)
  • Regression: JVM crash in tcnative-boringssl during mutual TLS handshake with chain (#5841)
  • Consolidate flushes even when no read in progress (#5808)
  • Support any FileRegion implementation when using epoll transport (#5825)
  • Ensure we not sent duplicate certificates when using OpenSslEngine (#5790)
  • AbstractByteBuf.forEachByteDesc(ByteProcessor) starts from wrong index (#5783)
  • Fix native library loading in Windows (#5776)
  • Use heapbuffers by default when using LocalChannel and LocalServerChannel (#5792)
  • Provide extra info together with handshake complete event (#5751)
  • HTTP/2: SETTINGS_HEADER_TABLE_SIZE should be an unsigned int (#5798)
  • Add support for Client Subnet in DNS Queries (RFC7871) (#5614)
  • Do not change writerIndex when decode DnsPtrRecord (#5784)
  • HTTP/2 Ensure default settings are correctly enforced and interfaces clarified (#5845)

New in Netty 4.1.5 (Sep 6, 2016)

  • Result of ByteBufUtil.compare(ByteBuf a, ByteBuf b) is dependent on ByteOrder of supplied ByteBufs (#5732)
  • Ensure fireChannelActive() is also called if Channel is closed in connect promise (#5724)
  • Ensure SslHandler.close(...) will not throw exception if flush of pending messages fail (#5685)
  • Static initializers can cause deadlock (#5730)
  • Detect if netty-tcnative is in classpath or just tcnative (#5666)
  • Ensure direct ByteBuffer are wrapped in as direct ByteBuf (#5629)
  • Allow to limit the maximum number of WeakOrderQueue instances per Thread (#5592)
  • Ensure correct ordering if a ChannelInitializer adds another ChannelInitializer (#5588)
  • Servers should not send duplicate intermediate certificates (#5606)
  • Not try to double release empty buffer in Unpooled.wrappedBuffer (#5605)
  • Ensure SslHandler not log false-positives when try to close the Channel due timeout (#5604)
  • Introduce allocation / pooling ratio in Recycler (#5594)
  • Ensure we not log missleading errors if the promise was already failed due errors (#5689)
  • HTTP/2 limit streams in all states (#5671)
  • Disable IPv6 address lookups when -Djava.net.preferIPv4Stack=false (#5659)
  • Add NonStickyEventExecutorGroup (#5579)
  • Fix RejectedExecutionException when using DnsAddressResolverGroup (#5612)

New in Netty 4.1.4 (Jul 27, 2016)

  • Set Recycler DEFAULT_INITIAL_MAX_CAPACITY to a more sane value (#5589)
  • Ensure shared capacity is updated correctly when WeakOrderQueue is collected (#5577)
  • Ensure WeakOrderQueue can be collected fast enough (#5569)
  • Ensure attributes and contained object can be collected as fast as possible (#5575)
  • Correctly return a retained slice if called SwappedByteBuf.retainedSlice(...) (#5593)
  • Allow ndots=0 in DnsNameResolver and search domain (#5571)

New in Netty 4.1.3 (Jul 17, 2016)

  • Changes:
  • Fix JDK9 direct ByteBuffer cleaner invocation (#5538)
  • Non-sticky thread groups in DefaultThreadFactory (#5533)
  • Enforce Recycler limit when recycling from different threads (#5528)
  • Avoid missed signals on a default promise (#5523)
  • Ensure ChannelHandler.handlerAdded(...) callback is executed directly when added from ChannelFutureListener added to the registration future. (#5515)
  • Not operate on serial execution assumption when using EventExecutor in the DefaultChannelPipeline.(#5506)
  • Make AbstractChannel.outboundBuffer volatile (#5509)
  • Fix improper synchronization in DefaultPromise (#5494)
  • DnsNameResolver search domains support (#5496)
  • DefaultHttp2RemoteFlowController reentry infinite loop (#5525)

New in Netty 4.1.2 (Jul 1, 2016)

  • Highlights:
  • Be able to use Netty in JDK9 (#5475), (#5474 ), (#5473)
  • Allow to inject RejectedExecutionHandler for different EventLoops and EventExecutors (#5441)
  • Allow to set max capacity for task queue for EventExecutors and EventLoops (#5440)
  • Add support for KeyManagerFactory when using SslProvider.OpenSsl (#5439)
  • Add support for SNIHostName when using Java8+ (#5417)
  • Pluggable resource leak detector (#5392)
  • Ensure OpenSslClientContext / OpenSslServerContext can be garbage-collected (#5380)
  • Use shaded dependency on JCTools instead of copy and paste (#5316)
  • DnsNameResolver should not bind locally. (#5461)
  • DnsNameResolver does not resolve property A+CNAME answer (#5413)
  • Optimize HPACK usage to align more with Netty types and remove heavy object creations (#5355)

New in Netty 4.1.0 (May 27, 2016)

  • Most notable features are:
  • codec-dns : Support for encode and decode DNS packets.
  • codec-http2 : Support for HTTP/2.
  • codec-memcached : Support for Memcached binary protocol.
  • codec-mqtt : Support for MQTT
  • codec-redis : Support for Redis protocol.
  • codec-smtp : Support for SMTP protocol (only client side atm).
  • codec-stomp : Support for Stomp.
  • handler-proxy : Support for bulding proxies.
  • resolver-dns : Alternative DNS resolver that is non-blocking and is using codec-dns.
  • resolver : Resolver interfaces.
  • Experimental APIs:
  • With this release we also introduce a new annotation (@UnstableApi) that we will use in the future to mark certain APIs as unstable, and so should be free to change these at any time. This will allow us to provide certain features to users earlier while still be able to make slightly changes when needed.
  • Notable changes:
  • As stated there are lot of changes, following are the more important for the "general" user, which are not related to new codecs.
  • Default ByteBufAllocator:
  • The default used ByteBufAllocator was changed to PooledByteBufAllocator. So if you want to use UnpooledByteBufAllocator you need to explicit configure it.
  • Resolving during Bootstrap.connect(...):
  • With this release of Netty you can make use of resolver-dns which contains a fully asynchronous DNS resolver. This can be configure on the Bootstrap and so allow to make the full DNS resolution during the connect non-blocking.

New in Netty 4.0.36 (Apr 4, 2016)

  • Highlights:
  • Not attempt to read from fd when channel is closed during read loop. (#5048)
  • EPOLL SelectStrategy (#5044)
  • EPOLL Socket Shutdown Fix (#5042)
  • Read if needed on NEED_UNWRAP (#5039)
  • Upgrade netty-tcnative to 1.1.33.Fork15 (#5025) (#4918)
  • Speed up the slow path of FastThreadLocal (#5012)
  • Fix setBytes when source is read-only ByteBuffer and target is pooled (#5011)
  • fix propagation of channelRegistered event in ChannelInitializer (#4995)
  • X509Certificate array used for trust managers is not a chain (#4973)
  • Allow to customize NIO (channel) select strategies (#4955)

New in Netty 4.1.0 RC 6 (Apr 2, 2016)

  • Customizable NIO and epoll select strategy (#4955 and #5044)
  • Deprecate WRITE_BUFFER_LOW/HIGH_WATER_MARK in favor of WRITE_BUFFER_WATER_MARK (#5060 and #4858)
  • Change the visibility of DefaultChannelId to public (#5057)
  • Fix propagation of channelRegistered() event in ChannelInitializer (#4995)
  • Fix incorrect name encoding/decoding in DNS records (#5064)
  • Fix missing @Sharable annotation in MqttEncoder (#5063)
  • Fix the bug where epoll ET with autoRead set to false will leave data on the RECV queue (#5061)

New in Netty 4.1.0 RC 5 (Mar 29, 2016)

  • Map HTTP/2 Streams to Channels (#4503)
  • IllegalReferenceCountException from HttpObjectDecoder when switching a protocol (#4504)
  • IOOBE in DefaultDnsRecordDecoder#decodeName (#5015)
  • Prevent nepotism with generational GCs (#5016)
  • Fix setBytes when source is read-only ByteBuffer and target is pooled #5011)
  • Speed up the slow path of FastThreadLocal (#5012)
  • Upgrade netty-tcnative to 1.1.33.Fork15 (#5025)
  • Read if needed on NEED_UNWRAP (#5039)
  • Not attempt to read from fd when channel is closed during read loop (#5048)

New in Netty 4.1.0 RC 4 (Mar 21, 2016)

  • DnsNameResolver: makes possible to define additional records in DNS query (#4871)
  • DnsNameResolverContext infinite loop (#4771)
  • HTTP/2 stream removed from map before onStreamClosed called (#4888)
  • Add support for directly decoding/encoding DNS PTR Records (#4912)
  • EPOLL ET AutoRead (#4919)
  • HTTP/2 DefaultHttp2Connection NPE (#4933)
  • Netty 4.1.0.CR1: DNS resolver accepts invalid FQDN with label length > 63 octet (#4935)
  • Netty 4.1.0.CR1: DNS resolver do not treat non-ASCII characters correctly (#4937)
  • Fix potential infinite loop when resolving CNAME records (#4946)
  • HTTP/2 DefaultHttp2ConnectionEncoder data frame size incorrect if error (#4965)

New in Netty 4.0.35 (Mar 21, 2016)

  • Add support for TCP_DEFER_ACCEPT and TCP_QUICKACK (#4951)
  • WebSocketHandshaker.finishHandshake could result in recursive channelRead event (#4533) (#4815)
  • Enabling SNI, OpenSSL client from netty does not work (#4746) (#4791)
  • Certificate failing set in OpenSslServerContext on Linux (#4793)
  • Enable SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER when using OpenSslContext (#4816)
  • OpenSslContext throws UnsupportedOperationException when Unsafe not available (#4828) (#4843)
  • Correctly pass ChannelPromise on to the next ChannelOutboundHandler when use CombinedChannelDuplexHandler (#4838)
  • Fix segfault if UnpooledUnsafeHeapByteBuf.getShort(..) is used and UNALGINED access is not possible. (#4845) (#4841)
  • Ensure handlerAdded(...) and handlerRemoved(...) is always called from the right thread (#4863)
  • Ensure read components can be discarded when COMPOSITE_CUMULATOR is used (#4880)
  • Correctly set the alert type depending of the CertificateException (#4885)
  • NetUtil can prevent using Netty due to SecurityManager denial (#4936) (#4977)
  • Guard against re-entrance in PendingWriteQueue (#4969)
  • Change arena to thread cache mapping algorithm to be closer to ideal (#4983)
  • Ensure all pending SSL data is written before closing channel during handshake error (#5003)
  • Add ! to allowed cookie value chars (#4998)

New in Netty 4.0.34 (Jan 29, 2016)

  • Highlights:
  • SslHandler does not send SSL close notify after receiving an invalid client certificate (#3900)
  • High CPU usage with SO_LINGER and sudden connection close (4.0.26.Final+) (#4449)
  • DefaultPromise LateListener notification order (#4492)
  • Respect ClientAuth set via OpenSslEngine constructor (#4576)
  • Throw ReadOnlyBufferException if unsafe buffer is used and dst is direct (#4577)
  • Prevent adding newline if Base64 buffer encoded ends directly on MAX_LINE_LENGTH (#4595
  • isKeepAlive is not supported by Epoll (#4604)
  • Customizable estimation for messages written outside the EventLoop (#4620)
  • Ensure closing a Socket / FileDescriptor multiple times will not throw exception (#4623)
  • Set DSCP bits for IPv6 when setting traffic class. (#4650)
  • Stop decoding if decoder was removed (#4651)
  • Ensure we only add OpenSslEngine to the OpenSslEngineMap when handshake is started (#4653)
  • Unpooled and Wrapped Buffer Leak (#4667)
  • Decryption failed or bad mac record in Android 5.0 (#4678)
  • IndexOutOfBoundsException for CompositeByteBuf (#4681)
  • Let CombinedChannelDuplexHandler correctly handle exceptionCaught. (#4702)
  • Correctly handle non handshake commands when using SniHandler (#4703)
  • Implement proper resource leak detection for CompositeByteBuf (#4713)
  • OpenSslEngine.setEnabledProtocols fails to enable protocols that are currently disabled (#4736)
  • Ensure ChannelHandler.handlerAdded(...) is always called as first method of the handler (#4776)
  • SslHandler should call beginHanshake once for the initial handshake (#4764)
  • Ensure the whole certificate chain is used when creating SslContext for client mode and SslProvider.OPENSSL is used (#4767)
  • Correctly handle wildcard address when bind to socket and using native transport (#4770)

New in Netty 4.1.0 RC 1 (Jan 25, 2016)

  • API for various compression codecs.

New in Netty 4.0.33 (Nov 5, 2015)

  • Fix race-condition when allocate from multiple-thread (#4388) (#4198)
  • OpenSslServerContext reinitializes the provided TrustManagerFactory with the key cert chain (#4387) (#4355)
  • Improve size calculation of messages when written from outside the EventLoop (#4380) (#4363)
  • Always return a real slice even when the length is 0 (#4368)
  • Fix possible assert error in GlobalEventExecutor (#4367) (#4357)
  • Correctly handle bitshifting if system does not support unaligned access (#4366)
  • Add *UnsafeHeapByteBuf for improve performance on systems with sun.misc.Unsafe (#4361)
  • Allow to disable reference count checks on every access of the ByteBuf (#4344)
  • A number of toString() methods on classes that implement ByteBufHolder can throw IllegalReferenceCountException (#4327)
  • Forward decoded messages more frequently (#4322) (#4284)
  • Ensure pending tasks are run when EmbeddedChannel.close(...) (#4322) (#4284
  • Implement SSLSession.invalidate() and isValid() for OpenSSLEngine (#4307)
  • Add support for server-side renegotiation when using OpenSslEngine (#4304)
  • Correctly reset markers for all allocations when using PooledByteBufAllocator(#4278)

New in Netty 4.1.0 Beta 7 (Oct 10, 2015)

  • DefaultHttp2RemoteFlowController may not write all pending bytes (#4258) (#4242)
  • Ensure close caused by write will happen before write promise is notified (#4225)
  • SpdyHttpEncoder fails to convert HttpResponse to SpdyFrame (#4190) (#4185)
  • StompHeaders constants can no longer be used to fetch headers from DefaultHeaders (#4247)
  • DefaultHttp2RemoteFlowController not allocating all available bytes (#4282) (#4266)

New in Netty 4.1.0 Beta 6 (Sep 5, 2015)

  • Faster and more memory efficient headers for HTTP, HTTP/2, STOMP and SPDY (#4051)
  • IllegalReferenceCountException in DNS resolver (#3797)
  • HTTP/2 GOAWAY Reference Count Issue (#3786)
  • Update HTTP/2 to RFCs (#3830)
  • Http2ConnectionHandler breaks channelReadComplete pipeline notification (#3948)
  • Regression in codec-http 4.1.0.Beta4 and later (#3962)
  • DnsResolver.resolve(...) fails when ipaddress is used (#3993)
  • NPE in DnsNameResolver in conjunction with a negative caching policy (#4065)
  • Add DnsNameResolver.resolveAll(...) which allows to resolve a name to many ips (#4035)

New in Netty 4.0.31 (Sep 5, 2015)

  • Allow to disable recycling (#4157)
  • Add TCP_USER_TIMEOUT (#4174)
  • Correctly set traffic class and so linger (#4136)
  • Fix IllegalStateException when HttpContentEncoder is used and 100 Continue response is used (#4115)
  • Correctly forward bytes when remove codec and handle channelInactive / channelReadComplete(...) (#4114)
  • Correctly handle Upgrade responses with special handling of Hixie 76 (#4113)
  • Support abstract domain sockets using epoll on linux (#4085)
  • HttpObjectAggregator doesn't check content-length header (#4083)
  • EPOLLRDHUP infinite loop (#4082)
  • MemoryRegionCache$Entry objects are not recycled (#4072)
  • Add support for IP_FREEBIND when using native transport (#4034)

New in Netty 4.0.30 (Aug 3, 2015)

  • Highlights:
  • ServerBootstrap.handler(...) will add handler before Channel is registered (#3933)
  • Ensure OpenSslSession informations can be retrieved even after shutdown (#3934)
  • NullPointerException in PendingWriteQueue (#3967) (#3991
  • Disable RC4 by default when using SslContext (#3987) (#4014)
  • FixedChannelPool does not count acquired channels precisely (#3988) (#4016)
  • Correctly register for EPOLLRDHUP when construct EpollSocketChannel for file descriptor (#4013)
  • Ensure cancelled scheduled tasks can be GC'ed ASAP (#3994)
  • Send full response for unsupported websocket versions (#3999)
  • Stop calling BIO_write once internal buffer is full (#3957)
  • Only do priming read if there is no space in dsts buffers (#3958)
  • Better handling of BUFFER_OVERFLOW when unwrap data (#3959)

New in Netty 4.0.29 (Jun 24, 2015)

  • Highlight:
  • Correctly handle errors when using OpenSSL (#3893)
  • Use 2 * cores as default minimum for pool arenas (#3891)
  • Not skip first cert when using OpenSslClientContext (#3658)
  • Guard against race when calling SslHandler.handshakeFuture().sync() (#3611)
  • Respect EPOLLERR event (#3611)
  • fixing small leak on exception on the transport-epoll-native allocation (#3844)
  • Synchronize on PoolSubpage head when allocate / free PoolSubpages (#3834)
  • Let PoolThreadCache work even if allocation and deallocation Thread are different (#3833)
  • Correctly handle connection refused with native transport (#3832)
  • Backport codec-haproxy (#3828)
  • No need to hold lock while destroy a chunk (#3827)
  • Do not try to init TrustManagerFactory if trustCertChainFile is null (#3821)
  • Expose metrics for PooledByteBufAllocator (#3802)
  • Support hostname verification when using OpenSSLEngine (#3794)

New in Netty 4.0.28 (May 9, 2015)

  • Highlights:
  • ChannelFuture is not done after shutdown (#3567)
  • Fix handling of non-auto read for ByteToMessageDecoder and SslHandler (#3658), (#3529), (#3587)
  • Correctly handle EPOLLRDHUP (#3611), (#3539)
  • Add ChannelPool abstraction and implementations (#3607), (#3218)
  • Change PoolThreadCache to use LIFO for better cache performance (#3553)
  • Add support for ALPN when using openssl + NPN client mode and support for CipherSuiteFilter (#3481) (#3481)
  • Add support for splice(...) (#3665)
  • Allow rejection of remote initiated renegotiation (#3750)
  • Not defer close of Channel when in flush (#3739)
  • Add support for mutual auth when using OpenSslEngine (#3732)
  • Fix possible IllegalStateException caused by closeNotifyTimeout when using SslHandler (#3727)
  • Validate cookie name and value characters (#3748)

New in Netty 4.0.27 (Apr 3, 2015)

  • Excessively large cumulation ByteBuf in SslHandler (#3567)
  • Cannot subclass HttpHeaders and build with JDK 7 with maven build of 4.0.26.Final (#3548)
  • Add supported for X509ExtendedTrustManager when using OpenSslEngine (#3494)
  • Respect -Djava.net.preferIPv4Stack when using epoll transport (#3478)
  • EpollSocketChannel.localAddress() returns always null if Native.connect() was not able to connect directly (#3463)

New in Netty 4.0.26 (Mar 4, 2015)

  • Fixes almost 70 issues / tasks. These include bug-fixes, performance improvements and new features.
  • One of bigger new features is support for UNIX Domain Sockets when using the native epoll transport.

New in Netty 4.0.25 (Jan 3, 2015)

  • SSL:
  • SslContext adds ALPN and mutual authentication support.
  • SslHandler.renegotiate() adds proper SSL renegotiation support.
  • SniHandler adds Server Name Indication support.
  • OpenSslEngine is now (almost) feature-complete with client mode support.
  • Works as a drop-in replacement of JDK stock SSLEngineImpl!
  • SPDY:
  • Pushed resource support
  • HTTP:
  • Higher performance

New in Netty 4.0.24 (Nov 10, 2014)

  • Most important fixes and enhancements:
  • #3058 #3057 - SslHandler - DirectByteBuffer - OutOfMemory
  • #3031 - Disable SSLv3.0 to avoid POODLE vulnerability
  • #2971 #2972 - WebSocketClientProtocolHandshakeHandler leaks
  • #2965 - Avoid vectored writes for small websocket messages
  • #2964 - zero-sized DefaultFileRegion leads to system stuck & high sys usage
  • #2955 - Improve WebSocket performance
  • #2940 - Add verification for websocket subprotocol on the client side
  • #2924 - head is not updated when trim MemoryRegionCache
  • #2880 - HTTP Content Decoder Cleanup Bug
  • #2871 #2867 - Workaround performance issue with IPv4-mapped-on-IPv6 addresses
  • #2860 - Add support for gathering writes with native transport when using EpollDatagramChannel
  • #2855 - Disable caching of PooledByteBuf for different threads
  • #2831 - Modify HttpObjectDecoder to allow parsing the HTTP headers in multiple steps
  • #2823 - Writing DefaultFileRegion with EpollSocketChannel may cause hang
  • #2789 - Allow efficient writing of CompositeByteBuf when using native epoll transport
  • #2586 - AbstractBootstrap.bind(...) should use correct EventLoop to notify on late registration

New in Netty 4.0.23 / 4.1.0 Beta 3 (Sep 4, 2014)

  • #2407 - Use a better default value for server socket backlog
  • #2768 - Fix an empty WebSocket close frame in hybi-00
  • #2769 - Fix ClassCastException when trying to send a FileRegion
  • #2771 - Fix a bug where EmbeddedChannel does not work with ChannelInitializer

New in Netty 4.0.21 (Jul 25, 2014)

  • Most important changes / fixes:
  • Epoll transport may cause StackOverflow when write many buffers via writev(...) (#2623)
  • Missing ensureAccessible() may cause SEGFAULT the JVM (#2622)
  • Could not find class 'sun.misc.Cleaner' on android (#2604)
  • Could not find class 'sun.nio.ch.DirectBuffer' on android (#2599)
  • Fix integer overflow in HttpObjectEncoder when write chunk > Integer.MAX (#2592)
  • Write to LITTLE_ENDIAN buffer in encoder is broken (#2587)
  • Inconsistent Little Endian Buffer Contents in 4.0.20.Final When Unsafe Enabled (#2580)
  • Optimize PoolChunk to not use DFS (#2582)
  • Faster Recycler implementation (#2570)
  • Provide a proper way to remove thread-local variables (#2578)

New in Netty 4.1.0 Beta 1 (Jul 7, 2014)

  • We support Android 4.0+ officially.
  • Channel ID is back, with global uniqueness.
  • You can customize Netty's thread model.
  • New or improved codecs:
  • Binary memcache protocol codec (by @daschl)
  • DNS protocol codec (by @mbakkar and @normanmaurer)
  • HAProxy protocol codec (by @jkeys089)
  • MQTT protocol codec (by @mousom)
  • STOMP codec (by @sskachkov)
  • You can also stream XML documents and JSON objects using XmlFrameDecoder (by @mcaserta) and JsonObjectDecoder (by @jakobbuchgraber.)
  • You have more control when HttpObjectAggregator receives an oversized message.

New in Netty 4.0.20 (Jun 13, 2014)

  • Most important changes / fixes:
  • Improve the allocation performance of pooled buffers larger than 8 KiB (#2518)
  • Use ByteBuf.readSlice(...).retain() to minimize memory copies (#2464)
  • ByteBuf implementation should only invert bytes if ByteOrder differ from native ByteOrder (#2436 and (#2531)
  • Introduce faster ThreadLocal (#2556)
  • Optimize DefaultChannelPipeline in terms of memory usage and initialization time (#2546)
  • Thread cache eviction task can erroneously prevent jvm from exiting (#2519)
  • Add OpenSslEngine (#2464)

New in Netty 4.0.19 / 5.0.0 Alpha 1 (May 1, 2014)

  • Most important changes / fixes:
  • Fix a resource usage problem in the WebSocket08FrameDecoder
  • Not cause busy loop when interrupt Thread of NioEventLoop
  • Various fixed in the native transport
  • Support for TCP_REUSEPORT in the native transport
  • Add Datagram support in native transport
  • Improve release of unused memory out of the buffer pool cache

New in Netty 4.0.18 (Apr 1, 2014)

  • Most important changes / fixes:
  • Implement thread-local cache for PooledByteBufAllocator (#808) (#2284) (#2264)
  • Write optimized Queue implementation for NioEventLoop (#1259) (#2265)
  • Add ZLIB_OR_NONE wrapper support to JdkZlibDecoder (#2016) (#2269)
  • NPE when using epoll transport (#2262)
  • epoll transport always calls ChannelInboundHandler.channelActive(), even when connection fails (#2280) (#2292)
  • Thread contention in ChannelHandlerAdapter.isSharable (#2289) (#2296)
  • Shutdown fails with native epoll (#2297)
  • Blocking in SingleThreadEventExecutor#startThread (#2307) (#2310)
  • Blocking in SelectorProvider#provider (#2308)
  • Netty 4.0.15 no longer works on Android (#2330)
  • "Promise already done" warning when cancelling ChannelFuture returned by bootstrap.connect() (#2349)

New in Netty 4.0.17 (Feb 28, 2014)

  • Most important changes / fixes:
  • Introduce a native transport for linux using epoll ET (#2229)
  • Web Socket server leaks a buffer during a handshake (#2188)
  • Race condition in AbstractReferenceCountedByteBuf and AbstractReferenceCounted (#2187)
  • Allow to cancel non-flushed writes (#2214) and (#2209)
  • Race in DefaultPormise which could lead to out of order notification of listeners (#2186) and (#2157)
  • Fix for releasing of the internal cumulation buffer in ByteToMessageDecoder (#2184)
  • Server sending websocket frame too quickly after upgrade causes client disconnect (#2173)
  • Not wakeup the EventLoop for writes as they will not cause a flush anyway (#2172)
  • Not throw an exception if WS subprotocol is not supported but just drop the header as stated in the RFC's (#2149)
  • Calling Channel.read() within channelReadComplete() not works when AutoRead is false (#2254)

New in Netty 4.0.15 (Jan 21, 2014)

  • Highlights:
  • NPE in AbstractNioUnsafe.finishConnect() (#2086)
  • CancelledKeyException on writeAndFlush(). (#2104)

New in Netty 5.0.0 Alpha 1 (Dec 23, 2013)

  • Simplified handler type hierarchy:
  • ChannelInboundHandler and ChannelOutboundHandler have been merged into ChannelHandler. ChannelHandler now has both inbound and outbound handler methods.
  • ChannelInboundHandlerAdapter, ChannelOutboundHandlerAdapter, and ChannelDuplexHandlerAdapter have been deprecated and replaced by ChannelHandlerAdapter.
  • Because it is now impossible to tell if a handler is an inbound handler or an outbound handler, CombinedChannelDuplexHandler has been replaced by ChannelHandlerAppender.
  • channelRead0() → messageReceived():
  • I know. It was a silly mistake. If you are using SimpleChannelInboundHandler, you have to rename channelRead0() to messageReceived().
  • Removal of deregistration:
  • Channel.deregister() has been removed. It was neither working nor used by users. Instead, we are going to allow the re-registration of a Channel to a different event loop in the future.
  • Easier and more precise buffer leak tracking:
  • Previously, it was not easy to find where the buffer leak occurred, and the leak warning was not very helpful. We now have an advanced leak reporting mechanism which can be enabled at the cost of increased overhead.
  • See Reference counted objects for more information. This feature also has been backported to 4.0.14.Final due to its importance.
  • PooledByteBufAllocator as the default allocator:
  • In 4.x, UnpooledByteBufAllocator was the default allocator in spite of its limitation. Now that PooledByteBufAllocator has been in the wild for a while and we have advanced buffer leak tracking mechanism, it is time to make it a new default.
  • Globally unique channel ID:
  • Every Channel now has a globally unique ID which is generated from:
  • MAC address (EUI-48 or EUI-64), preferrably a globally unique one,
  • the current process ID,
  • System#currentTimeMillis()
  • System#nanoTime()
  • a random 32-bit integer, and
  • a sequentially incremented 32-bit integer.
  • The ID of a Channel can be obtained using the Channel.id() method.
  • Even more flexible thread model:
  • A new interface called ChannelHandlerInvoker has been added to give a user much more control over which thread should call an event handler method. Instead of specifying an EventExecutor when adding a ChannelHandler to a ChannelPipeline, specify a custom ChannelHandlerInvoker implementation to take advantage of this feature.
  • EmbeddedChannel usability:
  • readInbound() and readOutbound() in EmbeddedChannel return an ad-hoc type parameter so you do not need to downcast their return values. This will reduce the verbosity of your unit test code quite a bit.
  • Ability to use Executor instead of ThreadFactory:
  • Some applications require a user to run his or her task in a given Executor. 4.x required a user to specify ThreadFactory when creating an event loop, but not anymore.
  • Class loader friendliness:
  • Some types such as AttributeKey were unfriendly to the applications that run in a container environment, but not anymore.
  • Codecs and handlers:
  • XmlFrameDecoder that enables streaming of XML documents.
  • Binary memcache protocol codec
  • SPDY/3.1 support (also backported to 4.x)
  • Refactored HTTP multipart codec

New in Netty 4.0.14 (Dec 23, 2013)

  • Advanced leak tracking mechanism that enables you find where you leaked a buffer easily. Read this article for more information.
  • SPDY/3.1 support
  • Support for charset property in HTTP multipart request boundary
  • 11 bug fixes

New in Netty 4.0.13 (Dec 3, 2013)

  • Most important changes / fixes:
  • ChannelHandlerContext exposes package private class ChannelOutboundInvoker (#1991)
  • IllegalStateException in the selector loop when a connection attempt is cancelled. (#1986)
  • discardSomeReadBytes() throws IndexOutOfBoundsException in CompositeByteBuf (#1976)
  • Optimize SslHandler (#1972)

New in Netty 4.0.12 (Nov 8, 2013)

  • Most important changes / fixes:
  • SslHandler renegotiation not working (#1964)
  • Fix regression in HashedWheelTimer when handling timeouts that overflow the thick (#1994) and ((#1959)
  • After the channel closes, client not always receives last part of data. (#1952)
  • DuplicatedByteBuf not correctly expand capacity (#1802)
  • Internal buffer capacity increase shouldn't discard read bytes (#1800)

New in Netty 4.0.11 (Oct 22, 2013)

  • Most important changes / fixes:
  • Websocket: an exception could be raised if the client sends message after it thinks the handshake is complete (#1941)
  • JdkZLibEncoder/Decoder hanging when payload length long (#1893)
  • ArrayIndexOutOfBoundsException in ChannelOutboundBuffer (#1890)
  • HttpPostRequestDecoder can return zero-ed out attributes (#1848)
  • More efficient handling of incomplete writes. (#1839)

New in Netty 4.0.10 (Oct 4, 2013)

  • Most important changes / fixes:
  • WebSocket08FrameDecoder may leak memory if channel is closed before the full frame was received (#1874)
  • Data corruption when duplicate/slice buffers and use on different EventLoops (#1865)
  • Channel writability change notifications sometimes fail to fire (#1832)
  • Using DatagramChannel.write(...) without bind the channel fails (#1830)
  • No easy way to bootstrap DatagramChannel which should not be bound (#1829)
  • CompositeByteBuf.removeComponent(lastIndex) throws IndexOutOfBoundException if components left (#1821)
  • HttpContentEncoder must pass through messages as it is when encoding is not needed / possible (#1818)

New in Netty 4.0.9 (Sep 7, 2013)

  • internalNioBuffer(...) lead to races when using from derived ByteBuf implementations (#1801)
  • LengthFieldBasedFrameDecoder produces IllegalArgumentException when frame is too big (#1798)
  • AbstractByteBuf.skipBytes(..) accept negative value and so set the readerIndex to a negative value (#1797)
  • HttpContentCompressor and HttpContentDecompressor not working (#1789)
  • GZIP decoding CRC32 and ISIZE in JdkZLibDecoder (#1788)
  • HTTP Chunk, wrong delimiter written (#1787)

New in Netty 4.0.8 (Sep 2, 2013)

  • Important changes / fixes:
  • IndexOutOfBoundException with direct buffer and gathering writes (#1782)
  • Cannot call public methods in AbstractBootstrap via reflection (#1780)
  • Unexpected exception in the selector loop (#1770)
  • LocalAddress's can collide in a multi-client setup (#1765)
  • java.lang.IllegalStateException: recycled already when using ChunkedWriteHandler (#1743)
  • java.lang.IllegalArgumentException when gathering write a DuplicatedByteBuf (#1739)
  • Add a JdkZlibDecoder which has no dependencies (#1481) and (#1735)

New in Netty 4.0.7 (Aug 9, 2013)

  • Important changes:
  • Channel.isWritable() does not work as aspected when write from outside the EventLoop (#1697) and (#1702)
  • SwappedByteBuf.readSlice(int) not respect ByteOrder. (#1704)
  • Allow to also write FileRegion and ChunkInput when using HTTP chunked. (#1693) and (#1699)

New in Netty 4.0.6 (Aug 1, 2013)

  • Important changes:
  • ChannelOutboundBuffer OOM Bug . (#1681)
  • Call to flush squashed by reentrancy check . (#1679)
  • ByteToMessageDecoder can pass a released buffer to PortUnificationServerHandler (#1664)
  • MessageToMessageEncoder.write() cause ArrayIndexOutOfBoundsException: -1 exception if encode() cause any exception . (#1656)

New in Netty 4.0.4 (Jul 23, 2013)

  • Important changes:
  • java.lang.OutOfMemoryError: Direct buffer memory. (#1574)
  • Stackoverflow using ImmediateEventExecutor. (#1602)
  • ChannelOutboundBuffer#addMessage may produce writes out of order (#1619)
  • Resource leak when write to a closed or not yet connected channel (#1621) and (#1624)

New in Netty 4.0.2 (Jul 18, 2013)

  • Important changes:
  • Fix resource leakage in WebSocketUtil.base64(...). (#1579)
  • SpdySessionHandler pending writes broken. (#1580) and #1582)
  • Data structure corruption and resource leak in ChannelOutboundBuffer. (#1596)
  • HttpObjectEncoder throws IllegalStateException if an empty HttpContent is written. (#1595)
  • Fix HttpContentDecoder (#1588)
  • Other changes:
  • More gracefully handling of IOException when using ServerChannels
  • Less confusing leak warning

New in Netty 4.0.0 (Jul 16, 2013)

  • Removal of MessageList:
  • When Netty reads one or more messages, channelRead() event is triggered for each message. Once the current read operation is finished, channelReadComplete() is triggered to tell the handler that the last channelRead() was the last message in the current batch.
  • Similarly, for outbound, write(ctx, list) has been split into the following: write(ctx, msg, promise) and flush(ctx)
  • Instead of writing a list of messages with a promise, a user is now supposed to call write(msg) multiple times and then call flush() to actually flush the buffered messages.
  • Please note that flush() doesn't have a promise with it. You must write something to get notified on completion. As you did in 3.x, the trick of writing an empty buffer works here, too.
  • Related miscellaneous changes:
  • ChannelInboundHandler.channelReadSuspended() has been replaced by channelReadComplete() introduced above, because they are essentially same.
  • Because MessageList is gone, codec framework now uses List instead of MessageList as an output parameter.
  • Other changes:
  • UnpooledByteBufAllocator is the default allocator. We suspect there might be a leak in the PooledByteBufAllocator. Until the investigation is complete and any bugs found are fixed, we are defaulting to UnpooledByteBufAllocator.
  • ByteBuf is now an abstract class rather than an interface. I found that converting ByteBuf from an interface to an abstract class gives the nice performance boost of around 5%. Hence ByteBuf was converted to an abstract class.
  • Channel.id() has been removed. It was practically impossible to generate a unique ID of a Channel with the new API because there is no way to manage the global map of the taken IDs

New in Netty 4.0.0 RC 9 (Jul 2, 2013)

  • NPE during ChannelOutboundBuffer.fail(...)
  • Proposal to improve performance of HttpObjectEncoder#encodeHeader

New in Netty 4.0.0 RC 6 (Jun 21, 2013)

  • Noteworthy changes:
  • SslHandler and JZlibEncoder now works correctly. (#1475 and #1471)
  • Android compatibility issues has been fixed. (#1451 and #1472)
  • voidPromise() works correctly now. (#1448)
  • SimpleChannelInboundHandler now releases the handled message by default. You can specify a boolean constructor parameter to revert to the old behavior (manual release). Note that other handler adapters do not release messages automatically. (#1446)
  • Making a connection attempt in NIO transport causes an IllegalStateException (#1467)
  • Various SPDY improvements from the folks at Twitter (#1456, #1463, #1476)
  • Less garbage production and efficiency fixes in SCTP transport (#1457)

New in Netty 4.0.0 RC 5 (Jun 14, 2013)

  • Fixed issues:
  • Determine the default number of heap/direct arenas of PooledByteBufAllocator conservatively improvement
  • UnsupportedOperationException after channel closed due to MessageToByteEncoder issue

New in Netty 4.0.0 RC 3 (May 20, 2013)

  • SslHandshakeCompletionEvent - Public Constructor? improvement cleanup
  • Allow to use VoidPromise for flush(...), write(...) and sendFile(...)
  • FileRegion and may "race" and so get written before bytes / messages won't fix
  • Make ImmediateEventExecutor Public
  • SnappyFramedDecoder Leaks Buffers in 4.0.0.CR2 defect
  • No elegant way to free non-in/outbound buffers held by a handler defect
  • Add lengthAdjustment option to LengthFieldPrepender
  • Thread safety and DefaultCompositeByteBuf / CompositeByteBuf defect
  • Snappy checksum error during decode defect
  • package the netty API doc to the release tar when netty go stable cleanup
  • HttpSnoopServer causes close connection when use 100-continue
  • Problem in file upload example needs info
  • UDT connect/disconnect see #1290 see #1329
  • duplicate invocation of same plugins due to needless fork of maven-source-plugin cleanup
  • WebSocketFrameAggregator should only throw TooLongFrameException once per complete frame defect
  • Snappy : Can the SnappyChecksumUtil class be made public? feature
  • Added client-server connection testcase for UDT
  • Cannot Reuse ChannelPromises for writes feature
  • Accepted UDTChannel is never closed defect

New in Netty 3.6.6 (May 15, 2013)

  • Fix multiple issues when handling HTTP multipart. (#1228), (#1313), (#1332) and (#1358)
  • HttpChunkAggregator throws IllegalArgumentException because of incorrect removal of chunked transfer-encoding (#1322)
  • Deadlock can happen when MemoryAwareThreadPoolExecutor with limit is used (#1310)

New in Netty 3.6.5 (May 9, 2013)

  • Fixed bugs:
  • Fix regression which could cause CPU-Spinning. (#1243) and (#1246)
  • Fix bug in AbstractTrafficShaper which could make it work incorrect if the system clock went backwards. (#1237)

New in Netty 4.0.0 RC 2 (May 9, 2013)

  • ChannelHandler and its sub-types:
  • ChannelHandler.beforeAdd/Remove(...) was removed because it made it very difficult to fullfill the thread model while not blocking at all.
  • ChannelHandler.afterAdd/Remove(...) was renamed to handlerAdded/Removed(...).
  • ChannelInbound/OutboundHandler and its sub-types:
  • Removed ChannelInboundHandler.freeInboundBuffer() and ChannelOutboundHandler.freeOutboundBuffer() because it's not useful anymore since we introduced reference counting in the previous releases.
  • Codec framework:
  • encode(...) and decode(...) now take a MessageBuf as a parameter and return void. Therefore, once you encoded or decoded a message, you have to add the message to the MessageBuf given as a parameter. This change simplifies message handling by enabling the removal of automatic array unfolding.
  • SslHandler:
  • SslHandler.handshake() was renamed to handshakeFuture() for consistency. Also, it now returns a Future instead of a ChannelFuture.
  • SslHandler.closeNotifyFutre() returns a Future instead of a ChannelFuture.
  • ByteBufHolder and its sub-types:
  • ByteBufHolder.data() was renamed to content(). The sub-types, for instance, include HttpContent, SctpMessage, SpdyDataFrame, and WebSocketFrame.
  • ChannelPipeline:
  • ChannelPipeline.remove/replaceAndForward(...) has been merged into remove/replace().
  • Bootstrap and ServerBootstrap:
  • ServerBootstrap.shutdown() and Bootstrap.shutdown() were deprecated. Please use the EventExecutorGroup.shutdownGracefully() method instead. See the next section for more information.
  • EventExecutorGroup and EventLoopGroup:
  • Fixed the API contract violation against java.util.concurrent.ExecutorService with respect to the Executor life cycle.
  • EventExecutorGroup.shutdown() has been deprecated by shutdownGracefully(). Use shutdownGracefully() wherever possible to avoid any trouble such as resource leak during a shutdown.
  • Changes in general:
  • This release fixed 90 issues. It's highly recommended to upgrade as soon as possible. We'd like to apologize that the upgrade process might not be as smooth as 'dropping the new JAR', but we believe all the changes were really worth the pain before going final.
  • Besides all the fixes, this release also ships with a few new features which may be worth some more details:
  • #762 adds WebSockeClientHandler which makes it super easy to write WebSocket clients with Netty. See the apidocs for more details.
  • #1207 adds WebSocketFrameAggregator which can be used to aggregate partial frames.
  • #1244 allows to pass DefaultChannelTransferPromise to sendFile(..) operation to keep track of the transfer progress.