You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "gitmodimo (via GitHub)" <gi...@apache.org> on 2025/08/21 07:49:55 UTC
[PR] GH-47384: [C++][Acero] Isolate BackpressureHandler from ExecNode [arrow]
gitmodimo opened a new pull request, #47386:
URL: https://github.com/apache/arrow/pull/47386
### Rationale for this change
Current BackpressureHandler needs to be provided with ExecNode, however the backpressure concept can be applied outside of ExecNode. It is currently needed to Facilitate ForceShutdown in AsofJoinNode. Current implementation however is not elegant and may still lead to deadlock after ForceShutdown in extreme case - when several batched get pushed after ForceShutdown and exceed the threshold.
### What changes are included in this PR?
-Remove ForceShutdown from BackpressureHandler.
-Reimplement ForceShutdown in BackpressureConcurrentQueue as onetime nonrecoverable queue clear that effectively unpauses source using handler.
### Are these changes tested?
There is no new functionality. Current tests should cover it.
### Are there any user-facing changes?
No
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-47384: [C++][Acero] Isolate BackpressureHandler from ExecNode [arrow]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #47386:
URL: https://github.com/apache/arrow/pull/47386#issuecomment-3209406409
:warning: GitHub issue #47384 **has no components**, please add labels for components.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-47384: [C++][Acero] Isolate BackpressureHandler from ExecNode [arrow]
Posted by "gitmodimo (via GitHub)" <gi...@apache.org>.
gitmodimo commented on PR #47386:
URL: https://github.com/apache/arrow/pull/47386#issuecomment-3273957516
> Would it be possible to write a case about it?
I added as UT. It would be difficult to orchestrate using ExecNodes.
This test fails against current main.
```
TEST(BackpressureConcurrentQueue, BackpressureTestStayUnpaused) {
BackpressureTestExecNode dummy_node;
auto ctrl = std::make_unique<TestBackpressureControl>(&dummy_node);
ASSERT_OK_AND_ASSIGN(auto handler,
BackpressureHandler::Make(&dummy_node, 2, 4, std::move(ctrl)));
BackpressureConcurrentQueue<int> queue(std::move(handler));
queue.Push(6);
queue.Push(7);
queue.Push(8);
ASSERT_FALSE(dummy_node.paused);
ASSERT_FALSE(dummy_node.stopped);
ASSERT_OK(queue.ForceShutdown());
for(int i=0;i<10;++i){
queue.Push(i);
}
ASSERT_FALSE(dummy_node.paused); // fails
ASSERT_TRUE(dummy_node.stopped);
}
```
Anyways I hope ForceShutdown will become obsolete after acero refactor succeeds .
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-47384: [C++][Acero] Isolate BackpressureHandler from ExecNode [arrow]
Posted by "conbench-apache-arrow[bot] (via GitHub)" <gi...@apache.org>.
conbench-apache-arrow[bot] commented on PR #47386:
URL: https://github.com/apache/arrow/pull/47386#issuecomment-3314359351
After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 0e7e70cfdef4efa287495272649c071a700c34fa.
There were no benchmark performance regressions. 🎉
The [full Conbench report](https://github.com/apache/arrow/runs/50830904799) has more details. It also includes information about 3 possible false positives for unstable benchmarks that are known to sometimes produce them.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-47384: [C++][Acero] Isolate BackpressureHandler from ExecNode [arrow]
Posted by "gitmodimo (via GitHub)" <gi...@apache.org>.
gitmodimo commented on code in PR #47386:
URL: https://github.com/apache/arrow/pull/47386#discussion_r2362457761
##########
cpp/src/arrow/acero/concurrent_queue_internal.h:
##########
@@ -164,10 +168,14 @@ class BackpressureConcurrentQueue : public ConcurrentQueue<T> {
ConcurrentQueue<T>::ClearUnlocked();
}
- Status ForceShutdown() { return handler_.ForceShutdown(); }
+ void ForceShutdown() {
+ shutdown_ = true;
+ Clear();
+ }
private:
BackpressureHandler handler_;
+ bool shutdown_{false};
Review Comment:
I believe this should be atomic. Thank you.
##########
cpp/src/arrow/acero/concurrent_queue_internal.h:
##########
@@ -164,10 +168,14 @@ class BackpressureConcurrentQueue : public ConcurrentQueue<T> {
ConcurrentQueue<T>::ClearUnlocked();
}
- Status ForceShutdown() { return handler_.ForceShutdown(); }
+ void ForceShutdown() {
+ shutdown_ = true;
+ Clear();
+ }
private:
BackpressureHandler handler_;
+ bool shutdown_{false};
Review Comment:
I believe this should be atomic. Thank you.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-47384: [C++][Acero] Isolate BackpressureHandler from ExecNode [arrow]
Posted by "zanmato1984 (via GitHub)" <gi...@apache.org>.
zanmato1984 commented on code in PR #47386:
URL: https://github.com/apache/arrow/pull/47386#discussion_r2360737539
##########
cpp/src/arrow/acero/util_test.cc:
##########
@@ -299,9 +297,26 @@ TEST(BackpressureConcurrentQueue, BackpressureTest) {
queue.Push(11);
ASSERT_TRUE(dummy_node.paused);
ASSERT_FALSE(dummy_node.stopped);
- ASSERT_OK(queue.ForceShutdown());
+ queue.ForceShutdown();
+ ASSERT_FALSE(dummy_node.paused);
+}
+
+TEST(BackpressureConcurrentQueue, BackpressureTestStayUnpaused) {
+ BackpressureTestExecNode dummy_node;
+ auto ctrl = std::make_unique<TestBackpressureControl>(&dummy_node);
+ ASSERT_OK_AND_ASSIGN(auto handler, BackpressureHandler::Make(2, 4, std::move(ctrl)));
Review Comment:
```suggestion
ASSERT_OK_AND_ASSIGN(auto handler, BackpressureHandler::Make(/*low_threshold=*/2, /*high_threshold=*/4, std::move(ctrl)));
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-47384: [C++][Acero] Isolate BackpressureHandler from ExecNode [arrow]
Posted by "zanmato1984 (via GitHub)" <gi...@apache.org>.
zanmato1984 commented on code in PR #47386:
URL: https://github.com/apache/arrow/pull/47386#discussion_r2360359903
##########
cpp/src/arrow/acero/concurrent_queue_internal.h:
##########
@@ -164,10 +168,14 @@ class BackpressureConcurrentQueue : public ConcurrentQueue<T> {
ConcurrentQueue<T>::ClearUnlocked();
}
- Status ForceShutdown() { return handler_.ForceShutdown(); }
+ void ForceShutdown() {
+ shutdown_ = true;
+ Clear();
+ }
private:
BackpressureHandler handler_;
+ bool shutdown_{false};
Review Comment:
Is it safe to be a plain variable rather than an atomic one?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-47384: [C++][Acero] Isolate BackpressureHandler from ExecNode [arrow]
Posted by "zanmato1984 (via GitHub)" <gi...@apache.org>.
zanmato1984 commented on PR #47386:
URL: https://github.com/apache/arrow/pull/47386#issuecomment-3313051578
I made a commit to fix the lint and rebased to main. Let's wait for CI then I'll merge.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-47384: [C++][Acero] Isolate BackpressureHandler from ExecNode [arrow]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #47386:
URL: https://github.com/apache/arrow/pull/47386#issuecomment-3209406382
:warning: GitHub issue #47384 **has been automatically assigned in GitHub** to PR creator.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-47384: [C++][Acero] Isolate BackpressureHandler from ExecNode [arrow]
Posted by "zanmato1984 (via GitHub)" <gi...@apache.org>.
zanmato1984 commented on PR #47386:
URL: https://github.com/apache/arrow/pull/47386#issuecomment-3313302353
The CI failure is non-related. Merging.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-47384: [C++][Acero] Isolate BackpressureHandler from ExecNode [arrow]
Posted by "zanmato1984 (via GitHub)" <gi...@apache.org>.
zanmato1984 merged PR #47386:
URL: https://github.com/apache/arrow/pull/47386
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org