github-actions[bot] commented on code in PR #69044:
URL: https://github.com/apache/doris/pull/69044#discussion_r4266076453
##########
fe/fe-core/src/main/java/org/apache/doris/common/profile/Profile.java:
##########
@@ -663,11 +681,14 @@ private String getProfileCompletionStateForStorage() {
return SummaryProfile.PROFILE_COMPLETION_STATE_COMPLETE;
}
- private void updateProfileCompletionStateForStorage() {
-
summaryProfile.setProfileCompletionState(getProfileCompletionStateForStorage());
+ private synchronized void updateProfileCompletionStateForStorage() {
+ // Freeze the terminal state before serialization. Concurrent
rendering must not
+ // replace INCOMPLETE with COLLECTING while the storage path is still
unpublished.
+ storageProfileCompletionState = getProfileCompletionStateForStorage();
+
summaryProfile.setProfileCompletionState(storageProfileCompletionState);
}
- private void updateProfileCompletionStateForDisplay() {
+ private synchronized void updateProfileCompletionStateForDisplay() {
Review Comment:
[P1] Avoid acquiring the Profile monitor under the manager read lock
Rendering a running profile can now deadlock query completion:
ProfileManager.getProfile() holds its readLock while getProfileByLevel() calls
this synchronized method, but Profile.updateSummary() already holds the same
Profile monitor when it calls ProfileManager.pushProfile(), which needs the
manager writeLock. If rendering acquires the read lock while the query holds
the Profile monitor, each waits indefinitely for the other's lock;
clearExecutionProfiles()/removeProfile() has the same reverse order. This can
hang the viewed query and block the global profile manager. Use a dedicated
lock shared by the two completion-state helpers so storage/display updates
remain serialized without acquiring the Profile monitor.
--
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]