hello-stephen commented on code in PR #71336:
URL: https://github.com/apache/doris/pull/71336#discussion_r4795499200


##########
be/src/runtime/fragment_mgr.cpp:
##########
@@ -598,41 +606,67 @@ std::string FragmentMgr::dump_pipeline_tasks(int64_t 
duration) {
         timespec now;
         clock_gettime(CLOCK_MONOTONIC, &now);
 
-        _pipeline_map.apply([&](phmap::flat_hash_map<std::pair<TUniqueId, int>,
-                                                     
std::shared_ptr<PipelineFragmentContext>>& map)
-                                    -> Status {
+        _pipeline_map.apply(
+                [&](phmap::flat_hash_map<std::pair<TUniqueId, int>,
+                                         
std::shared_ptr<PipelineFragmentContext>>& map) -> Status {
+                    auto& entries = shard_entries.emplace_back();
+                    for (auto& it : map) {
+                        auto elapsed = it.second->elapsed_time() / 1000000000;
+                        if (elapsed < duration) {
+                            // Only display tasks which has been running for 
more than {duration} seconds.
+                            continue;
+                        }
+                        entries.push_back({it.first.first, it.second, 
elapsed});
+                    }
+                    return Status::OK();
+                });
+
+        // Rendering can acquire RF context locks and task locks. Do not hold 
a shard
+        // lock here: RF publish failure can cancel a query and remove its 
fragments.
+        for (const auto& entries : shard_entries) {
             std::set<TUniqueId> query_id_set;
-            for (auto& it : map) {
-                auto elapsed = it.second->elapsed_time() / 1000000000;
-                if (elapsed < duration) {
-                    // Only display tasks which has been running for more than 
{duration} seconds.
-                    continue;
+            for (const auto& entry : entries) {
+                std::shared_ptr<QueryContext> query_ctx;
+                std::string task_debug_string;
+                int timeout_second;
+                bool is_timeout;
+                {
+                    auto pfc = entry.pfc.lock();

Review Comment:
   [P2] Keep stream-load fragment teardown off the HTTP event loop
   
   If a streaming load fails while its request body is still arriving, the 
scheduler can erase the fragment and release its reference while the dump holds 
this one. The dump then runs the fragment destructor, which invokes the 
stream-load finish callback inline. `StreamLoadAction::_send_reply()` waits for 
the upload's `handle()` or request cleanup. When both requests use the same 
HTTP worker, that worker is blocked in the dump and cannot process either 
event. Keep the diagnostic path from running the final fragment release on the 
HTTP event loop.



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