You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2018/12/11 15:49:42 UTC

[GitHub] rob05c commented on issue #1739: Traffic Monitor CRConfig and monitoring.json polls aren't synchronized

rob05c commented on issue #1739: Traffic Monitor CRConfig and monitoring.json polls aren't synchronized
URL: https://github.com/apache/trafficcontrol/issues/1739#issuecomment-446251341
 
 
   **Update**
   
   We have a PR to fix #1738 - PR #3104. But that PR does **not** fix this bug.
   The two bugs are:
   1. the `monitoring.json` data is not snapshotted
   2. the Traffic Monitor doesn't ensure the versions of `monitoring.json` and `CRConfig` match.
   
   This case is for number 2.
   
   **How to fix**
   
   The code needs changed to request both the CRConfig and monitoring.json immediately one after the other. But that doesn't completely fix it, because there's still a small race, if someone were to Snapshot in-between the Monitor's requests.
   
   So, the requests actually need to happen in a loop, where each are requested, their timestamps are compared, and if one is older, it's fetched again, in a loop, until both timestamps match.
   
   The pseudocode looks something like:
   ```
   crConfig  = GetCRConfig()
   monitoring = GetMonitoring()
   for {
     if crConfig.SnapshotTime < monitoring.SnapshotTime {
       crConfig = GetCRConfig()
       continue
     }
     if monitoring.SnapshotTime < crConfig.SnapshotTime {
       monitoring = GetMonitoring()
       continue
     }
     break
   }
   ```
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services