ray icon indicating copy to clipboard operation
ray copied to clipboard

[Core] GCS restart between creator actor death and job exit leaves placement-group bundles reserved

Open Pengkun-ZHU opened this issue 1 week ago • 0 comments

What happened + What you expected to happen

An actor creates a non-detached placement group, then exits while its job is still running. Ray correctly keeps the group at that point. The problem occurs if GCS restarts after the actor exits but before the job exits: when the job finally finishes, GCS does not ask the scheduler to release the bundles.

It is steadily reproducible in a C++ placement-group manager test. The only difference between the two runs was whether the manager reloaded from storage between the two deaths:

Sequence Bundle-release calls
Actor exits → job exits 1
Actor exits → GCS recovers → job exits 0

Expected: release the bundles exactly once after both owners have exited, regardless of whether GCS restarted. Otherwise, CPUs or GPUs can remain reserved with no owner left to use them.

Cause: the actor-death handler sets creator_actor_dead in memory but does not persist the change if the job is still alive. Recovery checks the creator job’s state but does not reconcile the creator actor’s state. The later job-exit notification therefore sees only one of the two deaths.

Related: #68611 describes a similar gap in GCS recovery, but for runtime-environment package references. This issue concerns placement-group ownership and scheduler reservations; it does not require a job to use working_dir or py_modules.

Versions / Dependencies

Versions / Dependencies

Ray version: master (3.0.0.dev0) OS: Ubuntu 24.04, Linux 6.18.54, x86-64 Python: 3.14.4 Bazel: 7.5.0 GCC: 15.2.0

Reproduction script

The shortest check for the underlying bug is to add the following assertion to the existing actor-dies-then-job-dies test, immediately after the actor-death notification and its RunIOService() call, while the job is still alive:

EXPECT_TRUE(LoadDataFromDataStorage()
                ->PlacementGroups()
                .at(placement_group_id)
                .creator_actor_dead());
bazel test //src/ray/gcs/tests:gcs_placement_group_manager_test \
  --test_filter='GcsPlacementGroupManagerTest.TestAutomaticCleanupWhenActorDeadAndJobDead' \
  --test_output=errors

The stored flag is false. To observe the cleanup failure itself, persist a live job row and a dead creator-actor row, initialize a fresh placement-group manager and scheduler from those tables, then deliver the job-death notification. The scheduler records zero release calls instead of one.

Issue Severity

Low: It annoys or frustrates me.

Pengkun-ZHU avatar Nov 29 '26 06:11 Pengkun-ZHU