yiguolei commented on code in PR #66810:
URL: https://github.com/apache/doris/pull/66810#discussion_r3802810404


##########
be/src/exec/sink/writer/paimon/paimon_jni_memory_manager.cpp:
##########
@@ -126,10 +144,64 @@ class PaimonJniMemoryManager::Impl {
     }
 
 private:
+    Status _reserve_memory_or_wait(int64_t bytes) const {
+        constexpr auto RETRY_INTERVAL = std::chrono::milliseconds(100);
+        bool waiting = false;
+        std::chrono::steady_clock::time_point wait_start;
+
+        while (true) {
+            auto* task_controller = _resource_context->task_controller();
+            if (task_controller->is_cancelled()) {
+                return Status::Cancelled(
+                        "Paimon JNI native page allocation stopped because the 
query was "
+                        "cancelled");
+            }
+            auto* fragment_mgr = ExecEnv::GetInstance()->fragment_mgr();

Review Comment:
   不要写这个代码,正确的做法是fragment mgr shut down 的时候需要去cancel 所有的querycontext, 
不要在这里感知fragment mgr 这种宏观结构了



-- 
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