-
Notifications
You must be signed in to change notification settings - Fork 526
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
feat(streaming): correctly implement LookupUnionExecutor #2169
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2169 +/- ##
==========================================
- Coverage 71.00% 70.90% -0.10%
==========================================
Files 654 657 +3
Lines 82894 83075 +181
==========================================
+ Hits 58862 58908 +46
- Misses 24032 24167 +135
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
Can we spawn new futures to buffer upstreams? Then the union executor could await these futures sequentially. |
Nope. Executors need back pressure. If union executors cannot send its data to downstream, it should stop receiving data from upstream. Also we assume one actor only creates one thread. There should not be un-managed spawned future in actors and executors. |
I have a solution that might look better. See 77c40a2. The key points are:
|
That's cool! I'll cherry-pick that commit to my branch... tomorrow for sure 🤣 |
And I still think spawning futures should be allowed. It wouldn't create new threads, just create a new task. In this case, I don't think the executor itself should care whether the upstreams would be blocked or not. If an upstream is not allowed to be blocked by downstream, we should spawn a future to poll it and connect futures using a channel as a buffer. Therefore, no matter what the downstream executor is, the upstream will never be blocked. |
For the case of union executor, I think it's okay to use a channel. Some small issues:
From my perspective, union is somehow a special kind of merge executor. If we model union executor as a merge executor, instead of something in the middle, I'll be totally fine with spawning tasks. |
Signed-off-by: Alex Chi <iskyzh@gmail.com>
Signed-off-by: Alex Chi <iskyzh@gmail.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Alex Chi <iskyzh@gmail.com>
47d84a1
to
55052b9
Compare
LGTM |
…into skyzh/correct-union
cc38347
to
50d17a4
Compare
Signed-off-by: Alex Chi iskyzh@gmail.com
What's changed and what's your intention?
Basically, what we are doing here is to forward data one input by one input. To avoid blocking upstream channels, we will need to store all data into a local buffer, which caused this part somehow not easy to read. Not sure how to write this in a better way. cc @wangrunji0408 may take a look and shed some light.
Checklist
Refer to a related PR or issue link (optional)
close #2141