Synchronization between rules and timer handlers

  • How does MyController handle rules and timers?
    Do they execute operations from concurrent threads?
    Should we worry about synchronization when scripts read/write repository variables?

    Or all scripts are executed by a single thread and there are no concurrency issues?

  • @benya Rules and timers are running on different threads. When you fetch repository variable, it becomes your local reference, If you do change it will override existing value.

  • @jkandasa We need some mechanism to prevent race condition.

  • Is any <String, Object> map accessible to Groovy scripts?
    It would be possible to store there generic objects and use them for synchronization.

  • @benya Do you face any issue with out Synchronization?

  • @jkandasa said:

    @benya Do you face any issue with out Synchronization?

    I face potential issue in the following scenario:

    • multiple PIRs tigger rule that reads/writes global variable and disables/enables timer
    • timer reads global variable as well
    • timer has counter=1 and self-disables when triggered

    Therefore I need to synchronize access to the global variable and modifications of timer object.
    Otherwise global variable and timer could be left in an unexpected state.

Suggested Topics