Skip to content

Titan can not handle timers set to more than 25 days

Summary

Titan can not handle timers set to more than 25 days

Steps and/or TTCN-3 code to reproduce

Set any timer to more than 2147483 seconds

What is the current bug behavior?

The too long timer will be set to 2147483 seconds and a Warning is displayed

What is the expected correct behavior?

The TTCN-3 standard does not specify maximum timeout limit, so any positive float value should be accepted and handled

Relevant logs and/or screenshots

Warning: The time needed for the first timer expiry is 2.14748e+07 seconds. The operating system does not support such long waiting at once. The maximum time of blocking was set to 2147483 seconds (ca. 24 days).

Possible fixes

In void TTCN_Snapshot::take_new(boolean block_execution)

          } else {

            // issue a warning: the user probably does not want such

            // long waiting

            TTCN_warning("The time needed for the first timer "

              "expiry is %g seconds. The operating system does "

              "not support such long waiting at once. The "

              "maximum time of blocking was set to %d seconds "

              "(ca. %d days).", block_time, MAX_BLOCK_TIME,

              MAX_BLOCK_TIME / 86400);

            // also modify the the timeout value to get out

            // immediately from the while() loop below

            timeout = current_time + (double)MAX_BLOCK_TIME;

            pollTimeout = MAX_BLOCK_TIME * 1000;

            handleTimer = TRUE;

          }

Titan version

8.0.0

Platform details (OS type and version)

All

/cc @aknappqwt

Edited by Adam Knapp