Skip to content

Enable flow control at python side - #2188

Merged
yunyad merged 16 commits into
masterfrom
yunyan-python-message-size
Oct 17, 2023
Merged

yunyad merged 16 commits into
masterfrom
yunyan-python-message-size

Conversation

@yunyad

@yunyad yunyad commented Oct 12, 2023 •

Copy link
Copy Markdown
Contributor

In this PR, we enable the flow control (backpressure) for the python side. Originally, only Java side has this feature. Given the growing reliance on Python recently, there's an urgent need to incorporate flow control on python. By enabling flow control at python side, pythonUDFs can automatically control the flow speed of tuples, which can significantly enhance the stability of workflows that utilize Python.

Here is a demo of python side flow control:
Peek 2023-10-16 18-34

As we can see, the difference between the pythonUDF and the sentiment analysis is around 200 from the start to the end.

@yunyad
yunyad requested a review from Yicong-Huang October 12, 2023 22:48
@yunyad yunyad changed the title Implement flowcontrol backpressure at python side based on message size Enable flow control at python side Oct 12, 2023

@Yicong-Huang Yicong-Huang left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. Please test more scenarios.

@shengquan-ni
shengquan-ni self-requested a review October 13, 2023 21:54

@shengquan-ni shengquan-ni left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@yunyad
yunyad merged commit 9ba4c63 into master Oct 17, 2023
@yunyad
yunyad deleted the yunyan-python-message-size branch October 17, 2023 01:41
@Yicong-Huang Yicong-Huang linked an issue Nov 2, 2023 that may be closed by this pull request
Xiao-zhen-Liu pushed a commit that referenced this pull request Jan 16, 2024
In this PR, we enable the flow control (backpressure) for the python
side. Originally, only Java side has this feature. Given the growing
reliance on Python recently, there's an urgent need to incorporate flow
control on python. By enabling flow control at python side, pythonUDFs
can automatically control the flow speed of tuples, which can
significantly enhance the stability of workflows that utilize Python.

Here is a demo of python side flow control:
![Peek 2023-10-16
18-34](https://github.com/Texera/texera/assets/114192306/4e5c1add-d188-48af-b406-25c6d9269e18)

As we can see, the difference between the pythonUDF and the sentiment
analysis is around 200 from the start to the end.

---------

Co-authored-by: Yicong Huang <[email protected]>
yangzhang75 pushed a commit to yangzhang75/texera that referenced this pull request Jun 22, 2026
In this PR, we enable the flow control (backpressure) for the python
side. Originally, only Java side has this feature. Given the growing
reliance on Python recently, there's an urgent need to incorporate flow
control on python. By enabling flow control at python side, pythonUDFs
can automatically control the flow speed of tuples, which can
significantly enhance the stability of workflows that utilize Python.

Here is a demo of python side flow control:
![Peek 2023-10-16
18-34](https://github.com/Texera/texera/assets/114192306/4e5c1add-d188-48af-b406-25c6d9269e18)

As we can see, the difference between the pythonUDF and the sentiment
analysis is around 200 from the start to the end.

---------

Co-authored-by: Yicong Huang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implementation of flow control APIs for python UDF

3 participants