Skip to content

Conversation

@zealotjin
Copy link
Contributor

The async job's streaming method runs indefinitely without specifically calling a break outside of the function.
This change handles the break when the job is complete AND all the stream data has been consumed. (The stop condition should check for the {status: "COMPLETED", stream: []} job response.

This is in sync with the runner stream implementation. The test case has also been updated.

@zealotjin zealotjin changed the title Update async job streaming stop condition and update test cases Update async job streaming stop condition and test cases Mar 20, 2025
if stream_partial["status"] not in FINAL_STATES:
if (
stream_partial["status"] not in FINAL_STATES
or len(stream_partial["stream"]) > 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or len(stream_partial.get("stream", [])) > 0

Copy link
Contributor

@Yhlong00 Yhlong00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me

@Yhlong00 Yhlong00 requested a review from deanq March 25, 2025 02:01
Copy link

@brosenpod brosenpod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@deanq deanq merged commit 969cc35 into runpod:main Mar 25, 2025
7 of 8 checks passed
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.

4 participants