[fix] Convert TransferQueueController to non-detached Ray actor to prevent resource leaks#43
Merged
0oshowero0 merged 2 commits intoAscend:mainfrom Mar 5, 2026
Merged
Conversation
Signed-off-by: 0oshowero0 <o0shower0o@outlook.com>
CLA Signature Pass0oshowero0, thanks for your pull request. All authors of the commits have signed the CLA. 👍 |
TransferQueueController to normal ray actorTransferQueueController to non-detached Ray actor to prevent resource leaks
Contributor
There was a problem hiding this comment.
Pull request overview
This PR changes how TransferQueueController is created and tracked so it is no longer a detached Ray actor, reducing the risk of orphaned controllers when tq.close() is not executed.
Changes:
- Introduces a module-level
_TRANSFER_QUEUE_CONTROLLERhandle to store the controller actor reference. - Creates
TransferQueueControlleras a normal (non-detached) named actor and reuses the cached handle where possible. - Updates
close()to attempt to kill the controller via the cached handle.
Comments suppressed due to low confidence (1)
transfer_queue/interface.py:252
- close() now attempts to kill the controller twice: first via the cached handle and then again by fetching the named actor. This is redundant work and makes the shutdown logic harder to reason about (and can produce avoidable errors/logs). Consider a single best-effort kill path (e.g., kill cached handle if present else try ray.get_actor()).
if _TRANSFER_QUEUE_CONTROLLER:
ray.kill(_TRANSFER_QUEUE_CONTROLLER)
_TRANSFER_QUEUE_CONTROLLER = None
try:
controller = ray.get_actor("TransferQueueController")
ray.kill(controller)
except Exception:
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
CLA Signature Pass0oshowero0, thanks for your pull request. All authors of the commits have signed the CLA. 👍 |
wuxibin89
approved these changes
Mar 5, 2026
0oshowero0
added a commit
that referenced
this pull request
Mar 30, 2026
Follow PR #43 to use non-detached Ray actor for `SimpleStorageUnit` Signed-off-by: 0oshowero0 <o0shower0o@outlook.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
Previously,
interface.pycreated a detached Ray actor for theTransferQueueController. Although atq.close()method was provided to terminate the actor, it might not be executed in the event of an unexpected crash or error. This could cause the detached actor to persist indefinitely, leading to resource leaks.Changes
TransferQueueControllerfrom a detached actor to a standard (non-detached) actor. Its lifecycle is now tied to the driver process.tq.close()method.