github-actions[bot] commented on code in PR #68658:
URL: https://github.com/apache/doris/pull/68658#discussion_r4140101788


##########
fe/fe-core/src/main/java/org/apache/doris/common/profile/Profile.java:
##########
@@ -314,7 +314,7 @@ public synchronized void updateSummary(Map<String, String> 
summaryInfo, boolean
                 long durationThreshold = executionProfiles.isEmpty()
                                     ? autoProfileDurationMs : 
executionProfiles.size() * autoProfileDurationMs;
                 if (this.queryFinishTimestamp != Long.MAX_VALUE && durationMs 
< durationThreshold) {
-                    ProfileManager.getInstance().removeProfile(this.getId());
+                    ProfileManager.getInstance().removeProfile(this);
                     if (LOG.isDebugEnabled()) {

Review Comment:
   [P1] Clean execution profiles for every dispatch retry. 
`handleQueryWithRetry` calls `finalizeQuery()` after each attempt, but it 
reuses this `Profile` when an `RpcException` from `coordBase.exec()` triggers a 
retry with a new query ID. The first short attempt marks `isQueryFinished` and 
reaches this removal; the retry then registers another `ExecutionProfile`, 
while both later `updateSummary` calls return immediately at the finished 
guard. `unregisterQuery` only marks that second entry finished, so it remains 
in `queryIdToExecutionProfiles` until the size-triggered fallback GC. Make each 
attempt eligible for cleanup and cover a failed-dispatch-then-retry case that 
checks both IDs.



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