Copilot commented on code in PR #62815:
URL: https://github.com/apache/doris/pull/62815#discussion_r3136657143


##########
be/src/exec/pipeline/dependency.h:
##########
@@ -194,6 +194,13 @@ class CountedFinishDependency final : public Dependency {
 
     void sub() {
         std::unique_lock<std::mutex> l(_mtx);
+        // _counter is unsigned: a stray sub() when counter is already 0 would
+        // underflow to UINT32_MAX and the dependency would never become ready,
+        // hanging the query forever. Fail loudly instead.
+        if (_counter == 0) [[unlikely]] {
+            throw Exception(ErrorCode::INTERNAL_ERROR,
+                            "CountedFinishDependency::sub() underflow on {}", 
debug_string());
+        }

Review Comment:
   `CountedFinishDependency::sub()` now throws `doris::Exception` / uses 
`ErrorCode::INTERNAL_ERROR` in an inline method, but `dependency.h` doesn’t 
include the header that defines them. Please add the appropriate include (e.g. 
`common/exception.h`) here so this header compiles standalone and doesn’t rely 
on transitive includes.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to