Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] In Generator, distinguish value yields and exceptions not by type but by control flow. #43413

Merged
merged 4 commits into from Mar 8, 2024

Conversation

rynewang
Copy link
Contributor

@rynewang rynewang commented Feb 24, 2024

Previously we use isinstance(output_or_exception, Exception) to find out if this is a raised Exception or a yielded value. This missed one case: yielded Exception. Though this is not likely to happen, it should be fixed for the sake of completeness.

Also removed dead code: yield_current_fiber which is not used anywhere.

Fixes #43412

Signed-off-by: Ruiyang Wang <rywang014@gmail.com>
Signed-off-by: Ruiyang Wang <rywang014@gmail.com>
Signed-off-by: Ruiyang Wang <rywang014@gmail.com>
@rynewang rynewang assigned rynewang and unassigned rkooo567 Feb 26, 2024
@jjyao jjyao assigned rkooo567 and unassigned rynewang Mar 4, 2024
@rynewang
Copy link
Contributor Author

rynewang commented Mar 8, 2024

@jjyao please merge

@jjyao jjyao merged commit fc9e82c into ray-project:master Mar 8, 2024
9 checks passed
@rynewang rynewang deleted the yield-exception branch March 8, 2024 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[core] Streaming Generator confused when user *yields* but not *raises* an Exception
3 participants