ray
ray copied to clipboard
[core] Generator task that returns more values than specified by num_returns should throw error instead
What happened + What you expected to happen
If a generator task is used, it should yield num_returns values (or a dynamic number if num_returns="dynamic"). Normally if a task errors, we store the exception as the value for all task returns. But currently, if a generator task stores some objects in shared memory, then errors, we don't replace the task return values.
To fix this, we should release the already-stored objects from shared memory and replace the task return value with the serialized error. Also related to #28686.
Versions / Dependencies
3.0dev
Reproduction script
See TODOs similar to the one in this unit test. This test checks that getting any of the task's return values should throw an error if the generator task raised an exception at any point.
Issue Severity
No response