Good day,
Apologies if this has been asked before, I couldn’t find any definitive answers from previous discussions. I want to know what the best way is to effect a true “fire_and_forget” method within Ray, without creating memory pressure within Ray’s object store after a few thousand fire-and-forget methods. I have tried numerous methods but it all seems to eventually cause my Sync Ray Actor to crash on segmentation faults after a few hours of execution.
The methods I’ve tried thus far:
- Simple “actor.method.remote()” without awaiting or ray.get the result. This (I believe) eventually causes memory build-up because the result is never retrieved to clear the ref from the Object Store
- “_ = actor.method.remote() del _”, which only deletes the object ref in the calling script but not from Ray’s object store.
- Tried using “ray._private.worker.global_worker.core_worker.free_objects([obj_ref], False)” and “ray.experimental.internal_kv._internal_kv_del(obj_ref.hex(), namespace=ray_namespace)”, both seem to create internal raylet issues
- Lastly creating a custom ObjectRefWaiter where a “fire_and_forget” method adds a Object Ref to a “set” within the waiter class which then “waits” on the object refs within a custom threading.Thread with “ray.wait”.
I’m using Ray 2.7.2, I believe there was previous “fire-and-forget” implementation in ray.util, but has since been removed.
Please let me know what the correct way is to implement a “fire_and_forget” methodology as it normally functions like ray.util.Queue “put” and “put_nowait” that I want to fire into this method to speed things up in my program. Any help will be appreciated.