You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@plc4x.apache.org by "Marcus Gotthardt (Jira)" <ji...@apache.org> on 2020/06/03 07:49:00 UTC

[jira] [Comment Edited] (PLC4X-153) Exception on S7 disconnect

    [ https://issues.apache.org/jira/browse/PLC4X-153?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17118363#comment-17118363 ] 

Marcus Gotthardt edited comment on PLC4X-153 at 6/3/20, 7:48 AM:
-----------------------------------------------------------------

yes, still happening.

We can reproduce this error when disconnecting the PLC during a request.

Java 11

S7-313 and S7-1500

PLC4x 0.6.0

*Update 02.06.2020:*

We fixed the problem at our side by adding a timeout at the CompletableeFuture like
{code:java}
CompletableFuture<? extends PlcReadResponse> asyncResponse = readRequest.execute();
asyncResponse.whenComplete((response, throwable) -> {
  // completition code
}).orTimeout(PLC_READ_TIMEOUT, TimeUnit.SECONDS){code}
 

 


was (Author: mgotthar):
yes, still happening.

We can reproduce this error when disconnecting the PLC during a request.

Java 11

S7-313 and S7-1500

PLC4x 0.6.0

> Exception on S7 disconnect
> --------------------------
>
>                 Key: PLC4X-153
>                 URL: https://issues.apache.org/jira/browse/PLC4X-153
>             Project: Apache PLC4X
>          Issue Type: Bug
>    Affects Versions: 0.4.0
>         Environment: Siemens S7-1500 PLC
> Windows 10 Notebook
> PLC4J + S7 Driver 0.4.0
> java version "1.8.0_231"
> Java(TM) SE Runtime Environment (build 1.8.0_231-b11)
> Java HotSpot(TM) Client VM (build 25.231-b11, mixed mode)
>            Reporter: Sebastian Wiendl
>            Priority: Major
>
> My PLC4J demo project at https://github.com/sewiendl/plc4j-demo yields the following output after/during disconnecting from the PLC:{code}all requests took PT2M6.261S
> Nov 14, 2019 10:05:13 AM io.netty.channel.DefaultChannelPipeline onUnhandledInboundException
> WARNUNG: 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.
> java.io.IOException: Eine vorhandene Verbindung wurde vom Remotehost geschlossen
> 	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:1125)
> 	at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:347)
> 	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:148)
> 	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:682)
> 	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:617)
> 	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:534)
> 	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496)
> 	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:906)
> 	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
> 	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
> 	at java.lang.Thread.run(Thread.java:748)
> disconnected{code}This bug report relates to my questions on the mailing list. I will also try to hand in a wireshark dump later.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)