apache / plc4x

PLC4X The Industrial IoT adapter
https://plc4x.apache.org/
Apache License 2.0
1.31k stars 410 forks source link

SocketCAN transport disconnections #635

Open ottlukas opened 2 years ago

ottlukas commented 2 years ago

SocketCAN transport can silently die due to swallowed exceptions:


2022-02-16 18:28:11.134 [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.
tel.schich.javacan.linux.LinuxNativeOperationException: Unable to read
from the socket - errorNumber=100, errorMessage='Network is down'
    at tel.schich.javacan.SocketCAN.read(Native
Method)
    at tel.schich.javacan.AbstractCanChannel.readSocket(AbstractCanChannel.java:160)
    at
tel.schich.javacan.RawCanChannelImpl.readUnsafe(RawCanChannelImpl.java:82) 
    at org.apache.plc4x.java.transport.socketcan.netty.SocketCANChannel.lambda$doConnect$0(SocketCANChannel.java:118)
 
  at java.lang.Thread.run(Thread.java:834) [?:?]

This error happened within an hour of application start so its most likely related to some CAN instability, however what's important is lack of proper handling of error. The connection in theory was still alive, however there was no data coming over it any more.

Imported from Jira PLC4X-334. Original Jira may contain additional context. Reported by: ldywicki.

chrisdutz commented 9 months ago

@splatch Is this still an issue?

splatch commented 9 months ago

I am afraid it is still an issue, I'd need to consult javacan if there is a way to spot shutdown of the interface.