mirror of
https://github.com/wassname/ray.git
synced 2026-07-05 19:41:13 +08:00
[Object Spilling] Name IO workers properly. (#11097)
* Fix. * Addressed code review.
This commit is contained in:
@@ -4,6 +4,7 @@ import time
|
||||
|
||||
import numpy as np
|
||||
import pytest
|
||||
import psutil
|
||||
import ray
|
||||
|
||||
|
||||
@@ -39,6 +40,16 @@ def test_spill_objects_manually(shutdown_only):
|
||||
ray.experimental.force_spill_objects([ref_to_spill])
|
||||
spilled_objects.add(ref_to_spill)
|
||||
|
||||
def is_worker(cmdline):
|
||||
return cmdline and cmdline[0].startswith("ray::")
|
||||
|
||||
# Make sure io workers are spawned with proper name.
|
||||
processes = [
|
||||
x.cmdline()[0] for x in psutil.process_iter(attrs=["cmdline"])
|
||||
if is_worker(x.info["cmdline"])
|
||||
]
|
||||
assert ray.ray_constants.WORKER_PROCESS_TYPE_IO_WORKER in processes
|
||||
|
||||
# Spill 2 more objects so we will always have enough space for
|
||||
# restoring objects back.
|
||||
refs_to_spill = (pinned_objects.pop(), pinned_objects.pop())
|
||||
|
||||
Reference in New Issue
Block a user