Repository navigation
Commit 936df2b
[fix](profile) Do not take the Profile monitor when rendering a profile
### What problem does this PR solve?
Issue Number: None
Related PR: #66227
Problem Summary: The previous commit made the two completion-state helpers of `Profile` synchronized on the Profile monitor, as branch-4.1 #66227 does. That inverts the lock order with `ProfileManager`: `ProfileManager.getProfile()` renders a profile under the manager's read lock, and `getProfileByLevel()` then waits for the Profile monitor, while `Profile.updateSummary()` holds the monitor and calls `ProfileManager.pushProfile()`, which waits for the manager's write lock (`clearExecutionProfiles()` and `removeProfile()` do the same). Viewing a running profile at the moment its query finishes could therefore hang the query and every later profile operation. The helpers now synchronize on a dedicated lock instead. Under it they only take the execution profile's report lock and the summary's info-string lock, and neither of those is held while waiting for the Profile monitor or a manager lock, so the storage and display updates stay serialized without a cycle.
### Release note
None
### Check List (For Author)
- Test: Unit Test
- `ProfileCompletionStateTest#renderingDoesNotWaitForProfileMonitor` renders a profile while the test holds the Profile monitor; with the synchronized helpers it times out. `ProfileCompletionStateTest` and `ProfileManagerTest` pass (36 tests).
- Behavior changed: No
- Does this need documentation: No
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>1 parent 9c248f8 commit 936df2b
2 files changed
Lines changed: 37 additions & 7 deletions
File tree
- fe/fe-core/src
- main/java/org/apache/doris/common/profile
- test/java/org/apache/doris/common/profile
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
122 | 126 | | |
123 | 127 | | |
124 | 128 | | |
| |||
681 | 685 | | |
682 | 686 | | |
683 | 687 | | |
684 | | - | |
685 | | - | |
686 | | - | |
687 | | - | |
688 | | - | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
689 | 695 | | |
690 | 696 | | |
691 | | - | |
692 | | - | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
693 | 701 | | |
694 | 702 | | |
695 | 703 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
201 | 223 | | |
202 | 224 | | |
203 | 225 | | |
| |||
0 commit comments