Skip to content

[core] Update GCS timing-related logic to use ClockInterface - #62502

Merged
edoakes merged 30 commits into
ray-project:masterfrom
edoakes:eoakes/gcs-clock
May 13, 2026
Merged

edoakes merged 30 commits into
ray-project:masterfrom
edoakes:eoakes/gcs-clock

Conversation

@edoakes

@edoakes edoakes commented Apr 10, 2026 •

Copy link
Copy Markdown
Collaborator

edoakes added 5 commits April 10, 2026 07:40
Signed-off-by: Edward Oakes <[email protected]>
Signed-off-by: Edward Oakes <[email protected]>
Signed-off-by: Edward Oakes <[email protected]>
Signed-off-by: Edward Oakes <[email protected]>
Signed-off-by: Edward Oakes <[email protected]>
@edoakes edoakes added the go add ONLY when ready to merge, run all tests label Apr 10, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the GCS (Global Control Service) components to use a centralized ClockInterface instead of direct calls to absl::Now() or current_sys_time_ms(). This change facilitates better testing by allowing for clock mocking. The refactoring involves updating constructors and method signatures across numerous GCS managers (Actor, Job, Node, Placement Group, etc.) and store clients to accept a clock reference. A high-severity issue was identified in RedisDelKeyPrefixSync where a stack-allocated clock is passed by reference to a shared context, potentially leading to a dangling reference if the context outlives the function scope.

edoakes added 7 commits April 10, 2026 07:54
Signed-off-by: Edward Oakes <[email protected]>
Signed-off-by: Edward Oakes <[email protected]>
Signed-off-by: Edward Oakes <[email protected]>
Signed-off-by: Edward Oakes <[email protected]>
Signed-off-by: Edward Oakes <[email protected]>
Signed-off-by: Edward Oakes <[email protected]>
@edoakes
edoakes marked this pull request as ready for review April 13, 2026 14:06
@edoakes
edoakes requested a review from a team as a code owner April 13, 2026 14:06
Comment thread src/ray/gcs/gcs_health_check_manager.cc Resolved
Signed-off-by: Edward Oakes <[email protected]>
@ray-gardener ray-gardener Bot added the core Issues that should be addressed in Ray Core label Apr 13, 2026
edoakes added 2 commits April 14, 2026 08:33
Signed-off-by: Edward Oakes <[email protected]>
Signed-off-by: Edward Oakes <[email protected]>
Signed-off-by: Edward Oakes <[email protected]>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

Reviewed by Cursor Bugbot for commit c3ca1f3. Configure here.

Comment thread src/mock/ray/core_worker/memory_store.h Resolved
auto end_to_end_creation_latency_us =
absl::Nanoseconds(scheduling_done_ns - request_received_ns) / absl::Microseconds(1);
ASSERT_TRUE(placement_group->GetStats().scheduling_latency_us() <
ASSERT_TRUE(placement_group->GetStats().scheduling_latency_us() <=

@Sparks0219 Sparks0219 Apr 24, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now that we control time shouldn't this be equal all the time? <= kind of contradicts the comment you made at line 1223

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Comment thread src/ray/util/clock.h Resolved
@edoakes
edoakes requested a review from Sparks0219 April 30, 2026 13:19
@edoakes

edoakes commented Apr 30, 2026

Copy link
Copy Markdown
Collaborator Author

cursor review

@Sparks0219 Sparks0219 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, looks like there's a couple merge conflicts though

@edoakes
edoakes merged commit 9ddd07f into ray-project:master May 13, 2026
3 checks passed
alexandrplashchinsky pushed a commit to alexandrplashchinsky/ray-alex that referenced this pull request May 29, 2026
…roject#62502)

- Update gcs components to use the interface introduced in:
ray-project#62476
- Updated tests to use `FakeClock`
- Added additional convenience methods to `ClockInterface`

---------

Signed-off-by: Edward Oakes <[email protected]>
Signed-off-by: Alexandr Plashchinsky <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Issues that should be addressed in Ray Core go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants