yancyang1989-gif commented on issue #2418:
URL: https://github.com/apache/plc4x/issues/2418#issuecomment-3949726500
I controlled the process by locking the same PLC address; you can try it to
see if it works.
public static <T> T withPlcConnection(String address,
PlcConnectionFunction<PlcConnection, T> operation) {
ReentrantLock lock = locks.computeIfAbsent(address, k -> new
ReentrantLock());
lock.lock();
try {
try (PlcConnection plcConnection = getConnection(address)) {
return operation.apply(plcConnection);
} catch (Throwable e) {
plcConnectionManager.removeCachedConnection(address);
throw new RuntimeException("Failed to get PLC connection for
address: " + address, e);
}
} finally {
lock.unlock();
}
}
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]