forked from ray-project/ray
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Streaming Generator] Fix a reference leak when a stream is deleted w…
…ith out of order writes. (ray-project#35591) Currently, when we delete the ObjectRefStream, we have the following logics. Keeps reading the next references If it reaches EoF, finish reading it. If there's no next index, finish reading it. Since all these unconsumed objects have a local reference we call RemoveLocalReferences to remove references. This doesn't work well when the items are written in out of order, For example, see the following example. Write (index 1) -> Delete -> Write (index 0). In this case, Delete thinks there's no references in the stream because it checks index 0 and found there's no references. It stops reading the stream. This works when the ordering of write is ensured, but not when it is not. This PR fixes the issue by instead reading all unconsumed references via GetItemsUnconsumed API. This API will return every references that are not read yet. When the references are written out of order,
- Loading branch information
Showing
3 changed files
with
79 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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