Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IOException: try to close channel #3

Closed
402293063 opened this issue Dec 25, 2020 · 2 comments
Closed

IOException: try to close channel #3

402293063 opened this issue Dec 25, 2020 · 2 comments

Comments

@402293063
Copy link

redisServer = new RedisServer();
redisServer.listener("127.0.0.1", 55555);

20-12-25 17:25:12,486 [] [pool-2-thread-1] INFO (Slf4jLogger.java info 30) - Redis server start @ 127.0.0.1:55555
2020-12-25 17:25:12,565 [] [pool-2-thread-5] INFO (Slf4jLogger.java error 50) - Error ! try to close channel : 远程主机强迫关闭了一个现有的连接。
java.io.IOException: 远程主机强迫关闭了一个现有的连接。
at sun.nio.ch.SocketDispatcher.read0(Native Method) ~[?:1.8.0_261]
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43) ~[?:1.8.0_261]
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223) ~[?:1.8.0_261]
at sun.nio.ch.IOUtil.read(IOUtil.java:197) ~[?:1.8.0_261]
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:378) ~[?:1.8.0_261]
at com.github.microwww.redis.ChannelInputStream.tryRead(ChannelInputStream.java:32) ~[redis-server-0.1.0-3.0.jar:?]
at com.github.microwww.redis.ChannelInputStream.available(ChannelInputStream.java:47) ~[redis-server-0.1.0-3.0.jar:?]
at java.io.FilterInputStream.available(FilterInputStream.java:168) ~[?:1.8.0_261]
at com.github.microwww.redis.protocal.jedis.JedisInputStream.available(JedisInputStream.java:39) ~[redis-server-0.1.0-3.0.jar:?]
at com.github.microwww.redis.RedisServer.readChannel(RedisServer.java:86) ~[redis-server-0.1.0-3.0.jar:?]
at com.github.microwww.redis.SelectSocketsThreadPool.lambda$null$0(SelectSocketsThreadPool.java:45) ~[redis-server-0.1.0-3.0.jar:?]
at com.github.microwww.redis.TaskThread.scheduling(TaskThread.java:39) ~[redis-server-0.1.0-3.0.jar:?]
at com.github.microwww.redis.SelectSocketsThreadPool.lambda$readableHandler$2(SelectSocketsThreadPool.java:44) ~[redis-server-0.1.0-3.0.jar:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_261]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_261]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_261]
2020-12-25 17:25:12,587 [] [pool-2-thread-5] INFO (Slf4jLogger.java info 30) - Remote KILLED: 127.0.0.1:53438

@lichangshu
Copy link
Member

redisServer = new RedisServer();
redisServer.listener("127.0.0.1", 55555);

20-12-25 17:25:12,486 [] [pool-2-thread-1] INFO (Slf4jLogger.java info 30) - Redis server start @ 127.0.0.1:55555
2020-12-25 17:25:12,565 [] [pool-2-thread-5] INFO (Slf4jLogger.java error 50) - Error ! try to close channel : 远程主机强迫关闭了一个现有的连接。
java.io.IOException: 远程主机强迫关闭了一个现有的连接。
at sun.nio.ch.SocketDispatcher.read0(Native Method) ~[?:1.8.0_261]
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43) ~[?:1.8.0_261]
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223) ~[?:1.8.0_261]
at sun.nio.ch.IOUtil.read(IOUtil.java:197) ~[?:1.8.0_261]
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:378) ~[?:1.8.0_261]
at com.github.microwww.redis.ChannelInputStream.tryRead(ChannelInputStream.java:32) ~[redis-server-0.1.0-3.0.jar:?]
at com.github.microwww.redis.ChannelInputStream.available(ChannelInputStream.java:47) ~[redis-server-0.1.0-3.0.jar:?]
at java.io.FilterInputStream.available(FilterInputStream.java:168) ~[?:1.8.0_261]
at com.github.microwww.redis.protocal.jedis.JedisInputStream.available(JedisInputStream.java:39) ~[redis-server-0.1.0-3.0.jar:?]
at com.github.microwww.redis.RedisServer.readChannel(RedisServer.java:86) ~[redis-server-0.1.0-3.0.jar:?]
at com.github.microwww.redis.SelectSocketsThreadPool.lambda$null$0(SelectSocketsThreadPool.java:45) ~[redis-server-0.1.0-3.0.jar:?]
at com.github.microwww.redis.TaskThread.scheduling(TaskThread.java:39) ~[redis-server-0.1.0-3.0.jar:?]
at com.github.microwww.redis.SelectSocketsThreadPool.lambda$readableHandler$2(SelectSocketsThreadPool.java:44) ~[redis-server-0.1.0-3.0.jar:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_261]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_261]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_261]
2020-12-25 17:25:12,587 [] [pool-2-thread-5] INFO (Slf4jLogger.java info 30) - Remote KILLED: 127.0.0.1:53438

You can ignore this error because the server closed the channel incorrectly. I recently tried to fix it

@lichangshu
Copy link
Member

We have no API to detect if the channel is closed, so If an IOException is caught, we assume that the client closed the connection automatically ! I changed the log level to DEBUG

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants