Skip to content

Correctly handle non IOException during read in NioServerSocketChannel#7806

Merged
normanmaurer merged 1 commit into
4.1from
server_channel_read_error
Mar 25, 2018
Merged

Correctly handle non IOException during read in NioServerSocketChannel#7806
normanmaurer merged 1 commit into
4.1from
server_channel_read_error

Conversation

@normanmaurer
Copy link
Copy Markdown
Member

Motivation:

Our code was not correct in AbstractNioMessageChannel.closeOnReadError(....) which lead to the situation that we always tried to continue reading no matter what exception was thrown when using the NioServerSocketChannel. Also even on an IOException we should check if the Channel itself is still active or not and if not stop reading.

Modifications:

Fix closeOnReadError impl and added test.

Result:

Correctly stop reading on NioServerSocketChannel when error happens during read.

Motivation:

Our code was not correct in AbstractNioMessageChannel.closeOnReadError(....) which lead to the situation that we always tried to continue reading no matter what exception was thrown when using the NioServerSocketChannel. Also even on an IOException we should check if the Channel itself is still active or not and if not stop reading.

Modifications:

Fix closeOnReadError impl and added test.

Result:

Correctly stop reading on NioServerSocketChannel when error happens during read.
@jaywiseman1971
Copy link
Copy Markdown

I'm running OpenHAB 2.3 and I'm encountering this issue describe with my camera binding. How can I get the correct file(s) to replace Netty on my OH2.3 installation?

2018-11-01 10:24:19.678 [WARN ] [io.netty.channel.nio.NioEventLoop ] - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@1c0066ff. 2018-11-01 10:24:19.696 [WARN ] [io.netty.channel.nio.NioEventLoop ] - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@a8ecbaa. 2018-11-01 10:26:49.594 [WARN ] [io.netty.channel.nio.NioEventLoop ] - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@580b0f7d. 2018-11-01 10:27:04.762 [WARN ] [io.netty.channel.nio.NioEventLoop ] - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@e5b6ed7. 2018-11-01 10:30:04.644 [WARN ] [io.netty.channel.nio.NioEventLoop ] - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@2100dd17.

Best, Jay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants