micronaut-projects / micronaut-core

Micronaut Application Framework
http://micronaut.io
Apache License 2.0
6.07k stars 1.07k forks source link

Never end log of "Selector.select() returned prematurely 512 times in a row " when turn off wifi of Android phone #3856

Open larryue opened 4 years ago

larryue commented 4 years ago

Thanks for reporting an issue, please review the task list below before submitting the issue. Your issue report will be closed if the issue is incomplete and the below tasks not completed.

NOTE: If you are unsure about something and the issue is more of a question a better place to ask questions is on Stack Overflow (https://stackoverflow.com/tags/micronaut) or Gitter (https://gitter.im/micronautfw/). DO NOT use the issue tracker to ask questions.

Task List

Steps to Reproduce

  1. Android phone connect to wifi normally, get a ip address for example 192.168.1.2.
  2. start a web server on android phone, set "micronaut.server.host" to current ip address, example 192.168.1.2
  3. turn wifi switch of phone to off.

Expected Behaviour

Web server stopped or other error which could be deal with.

Actual Behaviour

Repeatlly log a lot of warnning, cannot stop.

When I set "micronaut.server.host" to "0.0.0.0",It works fine.

2020-08-04 17:39:05.590 31100-31142/com.neutron.webtest W/neutron.webtes: Accessing hidden field Lsun/misc/Unsafe;->theUnsafe:Lsun/misc/Unsafe; (light greylist, reflection) 2020-08-04 17:39:05.593 31100-31142/com.neutron.webtest W/System.err: 1662 [Thread-3] INFO io.netty.util.internal.PlatformDependent - Your platform does not provide complete low-level API for accessing direct buffers reliably. Unless explicitly requested, heap buffer will always be preferred to avoid potential system instability. 2020-08-04 17:39:08.503 31100-31134/com.neutron.webtest I/neutron.webtes: ProcessProfilingInfo new_methods=6465 is saved saved_to_disk=1 resolve_classes_delay=5000 2020-08-04 17:40:19.977 31100-31283/com.neutron.webtest W/System.err: 76046 [nioEventLoopGroup-1-2] ERROR io.micronaut.http.server.netty.RoutingInBoundHandler - Micronaut Server Error - No request state present. Cause: Software caused connection abort 2020-08-04 17:40:19.978 31100-31283/com.neutron.webtest W/System.err: java.io.IOException: Software caused connection abort 2020-08-04 17:40:19.978 31100-31283/com.neutron.webtest W/System.err: at sun.nio.ch.FileDispatcherImpl.read0(Native Method) 2020-08-04 17:40:19.978 31100-31283/com.neutron.webtest W/System.err: at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43) 2020-08-04 17:40:19.978 31100-31283/com.neutron.webtest W/System.err: at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223) 2020-08-04 17:40:19.979 31100-31283/com.neutron.webtest W/System.err: at sun.nio.ch.IOUtil.read(IOUtil.java:197) 2020-08-04 17:40:19.979 31100-31283/com.neutron.webtest W/System.err: at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:421) 2020-08-04 17:40:19.979 31100-31283/com.neutron.webtest W/System.err: at io.netty.buffer.UnpooledHeapByteBuf.setBytes(UnpooledHeapByteBuf.java:282) 2020-08-04 17:40:19.980 31100-31283/com.neutron.webtest W/System.err: at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1133) 2020-08-04 17:40:19.980 31100-31283/com.neutron.webtest W/System.err: at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:350) 2020-08-04 17:40:19.980 31100-31283/com.neutron.webtest W/System.err: at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:148) 2020-08-04 17:40:19.980 31100-31283/com.neutron.webtest W/System.err: at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714) 2020-08-04 17:40:19.981 31100-31283/com.neutron.webtest W/System.err: at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650) 2020-08-04 17:40:19.981 31100-31283/com.neutron.webtest W/System.err: at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576) 2020-08-04 17:40:19.981 31100-31283/com.neutron.webtest W/System.err: at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493) 2020-08-04 17:40:19.982 31100-31283/com.neutron.webtest W/System.err: at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) 2020-08-04 17:40:19.982 31100-31283/com.neutron.webtest W/System.err: at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) 2020-08-04 17:40:19.986 31100-31283/com.neutron.webtest W/System.err: at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) 2020-08-04 17:40:19.986 31100-31283/com.neutron.webtest W/System.err: at java.lang.Thread.run(Thread.java:764) 2020-08-04 17:40:19.988 31100-31188/com.neutron.webtest W/System.err: 76052 [nioEventLoopGroup-1-1] WARN io.netty.channel.DefaultChannelPipeline - An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception. 2020-08-04 17:40:19.989 31100-31188/com.neutron.webtest W/System.err: java.io.IOException: Invalid argument 2020-08-04 17:40:19.990 31100-31188/com.neutron.webtest W/System.err: at sun.nio.ch.ServerSocketChannelImpl.accept0(Native Method) 2020-08-04 17:40:19.991 31100-31188/com.neutron.webtest W/System.err: at sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:422) 2020-08-04 17:40:19.994 31100-31188/com.neutron.webtest W/System.err: at sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:250) 2020-08-04 17:40:19.994 31100-31188/com.neutron.webtest W/System.err: at io.netty.util.internal.SocketUtils$5.run(SocketUtils.java:119) 2020-08-04 17:40:19.995 31100-31188/com.neutron.webtest W/System.err: at io.netty.util.internal.SocketUtils$5.run(SocketUtils.java:116) 2020-08-04 17:40:19.996 31100-31188/com.neutron.webtest W/System.err: at java.security.AccessController.doPrivileged(AccessController.java:69) 2020-08-04 17:40:20.000 31100-31188/com.neutron.webtest W/System.err: at io.netty.util.internal.SocketUtils.accept(SocketUtils.java:116) 2020-08-04 17:40:20.001 31100-31188/com.neutron.webtest W/System.err: at io.netty.channel.socket.nio.NioServerSocketChannel.doReadMessages(NioServerSocketChannel.java:147) 2020-08-04 17:40:20.002 31100-31188/com.neutron.webtest W/System.err: at io.netty.channel.nio.AbstractNioMessageChannel$NioMessageUnsafe.read(AbstractNioMessageChannel.java:75) 2020-08-04 17:40:20.002 31100-31188/com.neutron.webtest W/System.err: at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714) 2020-08-04 17:40:20.003 31100-31188/com.neutron.webtest W/System.err: at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650) 2020-08-04 17:40:20.004 31100-31188/com.neutron.webtest W/System.err: at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576) 2020-08-04 17:40:20.005 31100-31188/com.neutron.webtest W/System.err: at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493) 2020-08-04 17:40:20.006 31100-31188/com.neutron.webtest W/System.err: at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) 2020-08-04 17:40:20.007 31100-31188/com.neutron.webtest W/System.err: at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) 2020-08-04 17:40:20.011 31100-31188/com.neutron.webtest W/System.err: at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) 2020-08-04 17:40:20.012 31100-31188/com.neutron.webtest W/System.err: at java.lang.Thread.run(Thread.java:764) 2020-08-04 17:40:20.131 31100-31188/com.neutron.webtest W/System.err: 76200 [nioEventLoopGroup-1-1] WARN io.netty.channel.nio.NioEventLoop - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@b788085. 2020-08-04 17:40:20.134 31100-31188/com.neutron.webtest W/System.err: 76203 [nioEventLoopGroup-1-1] INFO io.netty.channel.nio.NioEventLoop - Migrated 1 channel(s) to the new Selector. 2020-08-04 17:40:20.238 31100-31188/com.neutron.webtest W/System.err: 76307 [nioEventLoopGroup-1-1] WARN io.netty.channel.nio.NioEventLoop - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@3c2cf0b. 2020-08-04 17:40:20.239 31100-31188/com.neutron.webtest W/System.err: 76308 [nioEventLoopGroup-1-1] INFO io.netty.channel.nio.NioEventLoop - Migrated 1 channel(s) to the new Selector. 2020-08-04 17:40:20.342 31100-31188/com.neutron.webtest W/System.err: 76411 [nioEventLoopGroup-1-1] WARN io.netty.channel.nio.NioEventLoop - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@a45a001. 2020-08-04 17:40:20.343 31100-31188/com.neutron.webtest W/System.err: 76412 [nioEventLoopGroup-1-1] INFO io.netty.channel.nio.NioEventLoop - Migrated 1 channel(s) to the new Selector. 2020-08-04 17:40:20.407 31100-31188/com.neutron.webtest W/System.err: 76476 [nioEventLoopGroup-1-1] WARN io.netty.channel.nio.NioEventLoop - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@f4d50e7. 2020-08-04 17:40:20.408 31100-31188/com.neutron.webtest W/System.err: 76477 [nioEventLoopGroup-1-1] INFO io.netty.channel.nio.NioEventLoop - Migrated 1 channel(s) to the new Selector. 2020-08-04 17:40:20.449 31100-31188/com.neutron.webtest W/System.err: 76517 [nioEventLoopGroup-1-1] WARN io.netty.channel.nio.NioEventLoop - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@d6b3b3d. 2020-08-04 17:40:20.450 31100-31188/com.neutron.webtest W/System.err: 76518 [nioEventLoopGroup-1-1] INFO io.netty.channel.nio.NioEventLoop - Migrated 1 channel(s) to the new Selector. 2020-08-04 17:40:20.482 31100-31188/com.neutron.webtest W/System.err: 76551 [nioEventLoopGroup-1-1] WARN io.netty.channel.nio.NioEventLoop - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@d141483. 2020-08-04 17:40:20.483 31100-31188/com.neutron.webtest W/System.err: 76552 [nioEventLoopGroup-1-1] INFO io.netty.channel.nio.NioEventLoop - Migrated 1 channel(s) to the new Selector. 2020-08-04 17:40:20.504 31100-31188/com.neutron.webtest W/System.err: 76573 [nioEventLoopGroup-1-1] WARN io.netty.channel.nio.NioEventLoop - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@6554e39. 2020-08-04 17:40:20.505 31100-31188/com.neutron.webtest W/System.err: 76574 [nioEventLoopGroup-1-1] INFO io.netty.channel.nio.NioEventLoop - Migrated 1 channel(s) to the new Selector. 2020-08-04 17:40:20.521 31100-31188/com.neutron.webtest W/System.err: 76590 [nioEventLoopGroup-1-1] WARN io.netty.channel.nio.NioEventLoop - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@ff975df. 2020-08-04 17:40:20.522 31100-31188/com.neutron.webtest W/System.err: 76591 [nioEventLoopGroup-1-1] INFO io.netty.channel.nio.NioEventLoop - Migrated 1 channel(s) to the new Selector. 2020-08-04 17:40:20.536 31100-31188/com.neutron.webtest W/System.err: 76605 [nioEventLoopGroup-1-1] WARN io.netty.channel.nio.NioEventLoop - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@73394f5. 2020-08-04 17:40:20.537 31100-31188/com.neutron.webtest W/System.err: 76606 [nioEventLoopGroup-1-1] INFO io.netty.channel.nio.NioEventLoop - Migrated 1 channel(s) to the new Selector. 2020-08-04 17:40:20.552 31100-31188/com.neutron.webtest W/System.err: 76620 [nioEventLoopGroup-1-1] WARN io.netty.channel.nio.NioEventLoop - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@ca990fb. 2020-08-04 17:40:20.553 31100-31188/com.neutron.webtest W/System.err: 76621 [nioEventLoopGroup-1-1] INFO io.netty.channel.nio.NioEventLoop - Migrated 1 channel(s) to the new Selector. 2020-08-04 17:40:20.565 31100-31188/com.neutron.webtest W/System.err: 76634 [nioEventLoopGroup-1-1] WARN io.netty.channel.nio.NioEventLoop - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@b758b71. 2020-08-04 17:40:20.566 31100-31188/com.neutron.webtest W/System.err: 76635 [nioEventLoopGroup-1-1] INFO io.netty.channel.nio.NioEventLoop - Migrated 1 channel(s) to the new Selector. 2020-08-04 17:40:20.578 31100-31188/com.neutron.webtest W/System.err: 76647 [nioEventLoopGroup-1-1] WARN io.netty.channel.nio.NioEventLoop - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@c7641d7. 2020-08-04 17:40:20.579 31100-31188/com.neutron.webtest W/System.err: 76648 [nioEventLoopGroup-1-1] INFO io.netty.channel.nio.NioEventLoop - Migrated 1 channel(s) to the new Selector. 2020-08-04 17:40:20.591 31100-31188/com.neutron.webtest W/System.err: 76660 [nioEventLoopGroup-1-1] WARN io.netty.channel.nio.NioEventLoop - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@c066dad. 2020-08-04 17:40:20.592 31100-31188/com.neutron.webtest W/System.err: 76661 [nioEventLoopGroup-1-1] INFO io.netty.channel.nio.NioEventLoop - Migrated 1 channel(s) to the new Selector. 2020-08-04 17:40:20.604 31100-31188/com.neutron.webtest W/System.err: 76673 [nioEventLoopGroup-1-1] WARN io.netty.channel.nio.NioEventLoop - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@1f32473. 2020-08-04 17:40:20.605 31100-31188/com.neutron.webtest W/System.err: 76674 [nioEventLoopGroup-1-1] INFO io.netty.channel.nio.NioEventLoop - Migrated 1 channel(s) to the new Selector. 2020-08-04 17:40:20.617 31100-31188/com.neutron.webtest W/System.err: 76686 [nioEventLoopGroup-1-1] WARN io.netty.channel.nio.NioEventLoop - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@b4937a9. 2020-08-04 17:40:20.618 31100-31188/com.neutron.webtest W/System.err: 76687 [nioEventLoopGroup-1-1] INFO io.netty.channel.nio.NioEventLoop - Migrated 1 channel(s) to the new Selector. 2020-08-04 17:40:20.630 31100-31188/com.neutron.webtest W/System.err: 76699 [nioEventLoopGroup-1-1] WARN io.netty.channel.nio.NioEventLoop - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@b5194cf. 2020-08-04 17:40:20.631 31100-31188/com.neutron.webtest W/System.err: 76700 [nioEventLoopGroup-1-1] INFO io.netty.channel.nio.NioEventLoop - Migrated 1 channel(s) to the new Selector. 2020-08-04 17:40:20.643 31100-31188/com.neutron.webtest W/System.err: 76712 [nioEventLoopGroup-1-1] WARN io.netty.channel.nio.NioEventLoop - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@4d4a565. 2020-08-04 17:40:20.644 31100-31188/com.neutron.webtest W/System.err: 76713 [nioEventLoopGroup-1-1] INFO io.netty.channel.nio.NioEventLoop - Migrated 1 channel(s) to the new Selector. 2020-08-04 17:40:20.656 31100-31188/com.neutron.webtest W/System.err: 76725 [nioEventLoopGroup-1-1] WARN io.netty.channel.nio.NioEventLoop - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@e7caeeb. 2020-08-04 17:40:20.657 31100-31188/com.neutron.webtest W/System.err: 76726 [nioEventLoopGroup-1-1] INFO io.netty.channel.nio.NioEventLoop - Migrated 1 channel(s) to the new Selector. 2020-08-04 17:40:20.669 31100-31188/com.neutron.webtest W/System.err: 76738 [nioEventLoopGroup-1-1] WARN io.netty.channel.nio.NioEventLoop - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@cef32e1. 2020-08-04 17:40:20.670 31100-31188/com.neutron.webtest W/System.err: 76739 [nioEventLoopGroup-1-1] INFO io.netty.channel.nio.NioEventLoop - Migrated 1 channel(s) to the new Selector. 2020-08-04 17:40:20.681 31100-31188/com.neutron.webtest W/System.err: 76750 [nioEventLoopGroup-1-1] WARN io.netty.channel.nio.NioEventLoop - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@af54ec7. 2020-08-04 17:40:20.682 31100-31188/com.neutron.webtest W/System.err: 76751 [nioEventLoopGroup-1-1] INFO io.netty.channel.nio.NioEventLoop - Migrated 1 channel(s) to the new Selector. 2020-08-04 17:40:20.693 31100-31188/com.neutron.webtest W/System.err: 76762 [nioEventLoopGroup-1-1] WARN io.netty.channel.nio.NioEventLoop - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@bcb1c1d. 2020-08-04 17:40:20.694 31100-31188/com.neutron.webtest W/System.err: 76763 [nioEventLoopGroup-1-1] INFO io.netty.channel.nio.NioEventLoop - Migrated 1 channel(s) to the new Selector. 2020-08-04 17:40:20.706 31100-31188/com.neutron.webtest W/System.err: 76775 [nioEventLoopGroup-1-1] WARN io.netty.channel.nio.NioEventLoop - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@d6e1063. 2020-08-04 17:40:20.707 31100-31188/com.neutron.webtest W/System.err: 76776 [nioEventLoopGroup-1-1] INFO io.netty.channel.nio.NioEventLoop - Migrated 1 channel(s) to the new Selector. 2020-08-04 17:40:20.715 31100-31188/com.neutron.webtest W/System.err: 76784 [nioEventLoopGroup-1-1] WARN io.netty.channel.nio.NioEventLoop - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@825d19. 2020-08-04 17:40:20.716 31100-31188/com.neutron.webtest W/System.err: 76785 [nioEventLoopGroup-1-1] INFO io.netty.channel.nio.NioEventLoop - Migrated 1 channel(s) to the new Selector. 2020-08-04 17:40:20.718 31100-31188/com.neutron.webtest W/System.err: 76787 [nioEventLoopGroup-1-1] WARN io.netty.channel.nio.NioEventLoop - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@1274fbf. 2020-08-04 17:40:20.719 31100-31188/com.neutron.webtest W/System.err: 76788 [nioEventLoopGroup-1-1] INFO io.netty.channel.nio.NioEventLoop - Migrated 1 channel(s) to the new Selector. 2020-08-04 17:40:20.721 31100-31188/com.neutron.webtest W/System.err: 76790 [nioEventLoopGroup-1-1] WARN io.netty.channel.nio.NioEventLoop - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@7d2b1d5. 2020-08-04 17:40:20.722 31100-31188/com.neutron.webtest W/System.err: 76791 [nioEventLoopGroup-1-1] INFO io.netty.channel.nio.NioEventLoop - Migrated 1 channel(s) to the new Selector. 2020-08-04 17:40:20.725 31100-31188/com.neutron.webtest W/System.err: 76793 [nioEventLoopGroup-1-1] WARN io.netty.channel.nio.NioEventLoop - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@b0b28db. 2020-08-04 17:40:20.725 31100-31188/com.neutron.webtest W/System.err: 76794 [nioEventLoopGroup-1-1] INFO io.netty.channel.nio.NioEventLoop - Migrated 1 channel(s) to the new Selector. 2020-08-04 17:40:20.728 31100-31188/com.neutron.webtest W/System.err: 76797 [nioEventLoopGroup-1-1] WARN io.netty.channel.nio.NioEventLoop - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@2999651. 2020-08-04 17:40:20.729 31100-31188/com.neutron.webtest W/System.err: 76798 [nioEventLoopGroup-1-1] INFO io.netty.channel.nio.NioEventLoop - Migrated 1 channel(s) to the new Selector.

Environment Information

Example Application

kyriehan89 commented 3 years ago

Hi ANy update? I have similar issue