forked from ray-project/ray
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Metrics] Fix flaky test_task_metrics + fix slow report issue from un…
…it tests (ray-project#32342) Every X seconds, when we record metrics, we check all pending updates from counter_map. If there's pending updates, we invoke the registered callback for the relevant updates, which record metrics. Currently, we have 3 counter_map. Regular (containing all data) & get & wait counter_map. For get and wait counter_map, although there are updates, we don't register callbacks (they are used to calculate correct RUNNING / GET / WAIT counts). So normally, this is what will happen. Task gets into RUNNING state. counter_map is updated and add a callback. Get is called, and get counter_map is updated. Callback is not updated (by design). If metrics are recorded after 2, the callback from regular counter_map is invoked and we record correct metrics. If metrics are recorded after 1, RUNNING state is recorded. But since we don't register callbacks for get counter map, when the next metrics are recorded, the relevant updates are not recorded. Flakiness comes from the latter case. This fixes the issue by having "no-op update" to the regular counter_map (e.g., Increment(0)). This will trigger counter_map to invoke a callback again which will correctly update get & wait status. I could also refactor the code to not use get&wait counter map, but this approach is much easier, so I decide to go with this approach. This PR also fixes the slow stats report issue.
- Loading branch information
Showing
5 changed files
with
37 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters