rob05c edited a comment 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: [email protected] With regards, Apache Git Services
