netty5/transport/src/main/java/io/netty/channel/nio
Scott Mitchell ed0668384b NIO read spin event loop spin when half closed (#7801)
Motivation:
AbstractNioByteChannel will detect that the remote end of the socket has
been closed and propagate a user event through the pipeline. However if
the user has auto read on, or calls read again, we may propagate the
same user events again. If the underlying transport continuously
notifies us that there is read activity this will happen in a spin loop
which consumes unnecessary CPU.

Modifications:
- AbstractNioByteChannel's unsafe read() should check if the input side
of the socket has been shutdown before processing the event. This is
consistent with EPOLL and KQUEUE transports.
- add unit test with @normanmaurer's help, and make transports consistent with respect to user events

Result:
No more read spin loop in NIO when the channel is half closed.
2018-03-28 20:02:57 +02:00
..
AbstractNioByteChannel.java NIO read spin event loop spin when half closed (#7801) 2018-03-28 20:02:57 +02:00
AbstractNioChannel.java Epoll flush/writabilityChange deadlock 2018-02-20 11:40:58 +01:00
AbstractNioMessageChannel.java Correctly handle non IOException during read in NioServerSocketChannel 2018-03-25 17:31:59 +02:00
NioEventLoop.java Reflective setAccessible(true) will produce scary warnings on the console when using java9+, dont do it 2018-01-30 12:18:34 +01:00
NioEventLoopGroup.java Allow to inject RejectedExecutionHandler for different EventLoops and EventExecutors 2016-06-24 17:08:30 +02:00
NioTask.java Move non socket specific stuff out of the socket package 2013-02-01 09:10:28 +01:00
package-info.java Move non socket specific stuff out of the socket package 2013-02-01 09:10:28 +01:00
SelectedSelectionKeySet.java Use a single array in SelectedSelectionKeySet 2017-02-16 15:10:37 -08:00
SelectedSelectionKeySetSelector.java Use a single array in SelectedSelectionKeySet 2017-02-16 15:10:37 -08:00