Details
-
Bug
-
Status: Closed
-
Blocker
-
Resolution: Fixed
-
0.6.0
-
None
Description
NettyPlcConnection creates a staitc timer, this timer may be closed in SingleItemToSingleRequestProtocol, and then the other NettyPlcConnection will get ExecutionException:
Caused by: java.lang.IllegalStateException: cannot be started once stoppedCaused by: java.lang.IllegalStateException: cannot be started once stopped at io.netty.util.HashedWheelTimer.start(HashedWheelTimer.java:350) at io.netty.util.HashedWheelTimer.newTimeout(HashedWheelTimer.java:429) at org.apache.plc4x.java.base.protocol.SingleItemToSingleRequestProtocol.write(SingleItemToSingleRequestProtocol.java:288)
/////////////////NettyPlcConnection.java
public abstract class NettyPlcConnection extends AbstractPlcConnection
{ /** * a \{@link HashedWheelTimer} shall be only instantiated once.
*/
// TODO: maybe find a way to make this configurable per jvm
protected final static Timer timer = new HashedWheelTimer();
protected final ChannelFactory channelFactory;
///////////////////////////////// SingleItemToSingleRequestProtocol.java
@Override
public void channelInactive(ChannelHandlerContext ctx) throws Exception