IVCTool / IVCT_Framework

For IVCT Framework Developers. Core System for the IVCT (Integration, Verification and Certification Tool) for HLA Federates
Apache License 2.0
16 stars 4 forks source link

Runner should wait on ActiveMQ to be up #166

Closed bergtwvd closed 5 years ago

bergtwvd commented 5 years ago

Currently the TCrunner does not wait for the ActiveMQ to be up. Depending on the start sequence of the various components the connect succeeds or fails. This is a race condition.

The TC Runner should attempt to connect several times (like n times 1 attempt/second) to the ActiveMQ before giving up.

ducana commented 5 years ago

Checked the problem and found out that the Logback module tries to connect to JMS, but fails and does not retry. Will add a sleep of 10s at the beginning of TCrunner which should also be configurable in IVCT.properties / environment variables. Propose to use LOGBACK_WAIT_TIME as the name of this value since it may affect other processes in the future not just TCrunner .

bergtwvd commented 5 years ago

If possible, could you implement a retry-mechanism? I just don't like the idea that booting up a system depends on arbitrary chosen sleep times.

ducana commented 5 years ago

The Logback module quietly continues to work even if the JMS connection fails ie. no error. Thus have decided to change the sequence of method calls: 1) resolve configuration/environment variables, 2) connect to JMS for the IVCT queues/topics, 3) Logback initiation. The calls in 2) have a re-try mechanism and thus 3) should be able tp connect to JMS without any problems. The drawback is that messages created in steps 1) and 2) will not appear in test session reports created by the LogSink. These messages will only appear in the TC.exec console.

ducana commented 5 years ago

Changed and tested the altered sequence of calls. The module to connect to JMS for the IVCT queues/topics is called first, then the Logback module is called.