An existing connection was forcibly closed by the remote host

891 views
Skip to first unread message

kesha...@javra.com

unread,
Jul 3, 2017, 12:20:19 AM7/3/17
to grpc.io
I using the following environment. 

Windows 7 64 bit.
Java : jdk1.8.0_131
protobuf-gradle-plugin:0.8.1
protoc:3.3.0
protoc-gen-grpc-java:1.4.0


But while running the project I get response for first call only and on server side I obtain following error after that.

io.grpc.netty.NettyServerTransport notifyTerminated
SEVERE: Transport failed
java.io.IOException: An existing connection was forcibly closed by the remote host
	at sun.nio.ch.SocketDispatcher.read0(Native Method)
	at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43)
	at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
	at sun.nio.ch.IOUtil.read(IOUtil.java:192)
	at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380)
	at io.netty.buffer.PooledUnsafeDirectByteBuf.setBytes(PooledUnsafeDirectByteBuf.java:288)
	at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1100)
	at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:372)
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:123)
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:644)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:579)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:496)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:458)
	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
	at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:138)
	at java.lang.Thread.run(Thread.java:748)

Can any one suggest me the solution why this is happening?
user_info.proto
UserServiceClient.java
UserServiceServer.java
build.gradle
UserServiceImpl.java

Carl Mastrangelo

unread,
Jul 12, 2017, 4:26:50 PM7/12/17
to grpc.io
Could you try channel.shutdownNow() instead of shutdown()?  

I think that logged message is somewhat of a hypochondriac. 
Reply all
Reply to author
Forward
0 new messages