You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@plc4x.apache.org by "Łukasz Dywicki (Jira)" <ji...@apache.org> on 2020/11/07 23:11:00 UTC
[jira] [Created] (PLC4X-257) Timedout operations can hang
communication
Łukasz Dywicki created PLC4X-257:
------------------------------------
Summary: Timedout operations can hang communication
Key: PLC4X-257
URL: https://issues.apache.org/jira/browse/PLC4X-257
Project: Apache PLC4X
Issue Type: Bug
Components: Core
Affects Versions: 0.8.0
Reporter: Łukasz Dywicki
Currently timed out reply handler registrations are removed. However their {{onTimeout}} consumer does not gets called resulting in hanged transaction which will never complete cause call of {{transaction.endRequest()}} will never happen. SocketCAN transport does not have direct support for timeouts, some messages just come later than expected due to bus arbitration process.
Not sure if same is case for IP based communication. Reproduction procedure is rather straight - launch sample program going to s7 simulator and hold read longer than configured timeout.
Faulty code:
{code:lang=java|title=Modifications to Plc4xNettyWrapper}
// Timeout?
if (registration.getTimeout().isBefore(Instant.now())) {
logger.debug("Removing {} as its timed out (was set till {})", registration, registration.getTimeout());
+ // pass timeout back to handler so it can do ie. transaction compensation
+ registration.getOnTimeoutConsumer().accept(new TimeoutException());
iter.remove();
continue;
}
{code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)