You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@plc4x.apache.org by "Łukasz Dywicki (Jira)" <ji...@apache.org> on 2020/11/08 21:18:00 UTC

[jira] [Commented] (PLC4X-257) Timedout operations can hang communication

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

Łukasz Dywicki commented on PLC4X-257:
--------------------------------------

Both issues are related to timeouts.

> 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
>            Priority: Major
>
> 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)