Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • athena athena
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Jira
    • Jira
  • Merge requests 157
    • Merge requests 157
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • Code review
    • Issue
    • Repository
  • Activity
  • Graph
  • Commits
Collapse sidebar
  • atlas
  • athenaathena
  • Merge requests
  • !31834

Avoid race conditions in AlgorithmTimer

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Rafal Bielski requested to merge rbielski/athena:algorithm-timer into master Apr 07, 2020
  • Overview 8
  • Commits 2
  • Pipelines 1
  • Changes 5

The goal of this MR is to avoid race conditions in AlgorithmTimer as found in ATR-20796 / ATR-20918.

The issue (most likely) was due to the undefined behaviour of the C posix timer when calling timer_delete while a callback on timeout was already pending, but not yet executed.

Step 1: Implement a unit test reproducing the race condition.
Step 2: Change the AlgorithmTimer implementation to reproducibly pass the test.

Implemented a unit test which was failing in around 20-30% executions in the test3() function due to this issue. Then implemented a flag protecting from the race condition and ran the test 50 times, all were successful.

cc @fwinkl, @tbold, @aporeba

Edited Apr 07, 2020 by Rafal Bielski
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: algorithm-timer