# Ray.wait with fetch local= false isn't working properly

**URL:** <https://discuss.ray.io/t/ray-wait-with-fetch-local-false-isnt-working-properly/22316>\
**Category:** Ray Core\
**Created:** [April 15, 2025, 5:50am UTC](https://discuss.ray.io/t/ray-wait-with-fetch-local-false-isnt-working-properly/22316 "2025-04-15T05:50:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shiranbi](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@shiranbi](https://discuss.ray.io/u/shiranbi)\
**Post date:** [April 15, 2025, 5:50am UTC](https://discuss.ray.io/t/ray-wait-with-fetch-local-false-isnt-working-properly/22316/1 "2025-04-15T05:50:51Z")

</div>

**1. Severity of the issue: (select one)**  
 Medium: Significantly affects my productivity but can find a workaround.

**2. Environment:**

- Ray version: 2.44.0
- Python version: 3.12
- OS: ubuntu 22.04
- Cloud/Infrastructure: on prem
- Other libs/tools (if relevant):

**3. What happened vs. what you expected:**

- Expected: ray.wait with fetch\_local=False shouldn’t bring data into ray head
- Actual: i saw the object store of the ray head being filled

I am running ray head + 1 ray node as following:  
ray start --head --port=9654 --num-cpus=0 --block --dashboard-host=0.0.0.0 --object-store-memory=4294967296

ray start --address=172.17.0.5:9654 --num-cpus=0 --block --resources=‘{“Foo”:7}’ --object-store-memory=4294967296

i am connecting to the cluster from outside as follows:  
context = ray.init(address=“ray://172.17.0.5:10001”)

I have an actor with the following function  
@ray.method(num\_returns=3)  
def run\_task\_return\_big\_nd\_array(self) → tuple[bool, NDArray, float]:

```
    big_array = np.zeros((10000, 10000), dtype=np.uint16)
    end_time = time.time()
    done = True

    return done, big_array, end_time

```

The test code is as follows:  
ray\_actor = MaximizerRayActor.options(resources={“Foo”: 1}).remote()  
ray\_actor.wait.remote()

```
    refs = []
    for i in range(test_loops):
        done, res_ref, time_ref = ray_actor.run_task_return_big_nd_array.remote()
        ready, not_ready = ray.wait([done, res_ref, time_ref], num_returns=3, fetch_local=False)
        #d = ray.get(done)
        refs.append([done, res_ref, time_ref])
    time.sleep(10)
    ray.kill(ray_actor)

```

if the test code is like this, i see the object store of the ray head increasing (as well as the worker) but fetch\_local equals false in ray.wait, so i don’t understand why  
if i remove the ray.wait and put d = ray.get(done), the ray.head object store doesn’t increase and i still know that the task is complete.

How can i use the ray.wait to understand the task is complete without bringing over data?

---

<div class="post-metadata">

**Author:** ![eoakes](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/eoakes/32/7825_2.png) [@eoakes](https://discuss.ray.io/u/eoakes)\
**Post date:** [April 16, 2025, 2:34pm UTC](https://discuss.ray.io/t/ray-wait-with-fetch-local-false-isnt-working-properly/22316/2 "2025-04-16T14:34:47Z")

</div>

Hi @shiranbi could you please file this as an issue on the Ray github? If you can include a runnable reproduction script that will make it much easier for us to help diagnose & fix the problem.
