High CPU from repeated failed AX app registration retries #2084
-
SymptomI observed AeroSpace repeatedly staying around 58-65% CPU for several minutes. The measurements were taken on a local custom build, but the hot path and fix candidate are in upstream Trigger / amplificationRepeated read-only CLI calls appear to amplify the issue, for example from a status-bar/helper app polling AeroSpace. In the sample, the read-only request path repeatedly went through focus/window refresh plumbing and reached: Root-cause observationFor a process where AX registration fails, In my sample this was visible as thousands of short-lived threads for Dock: The pattern appears to be:
There is currently no short negative cache/backoff for failed AX app registrations, so polling can turn this into a tight retry loop. Local validationBefore the local fix, with stale/polling helpers removed but the app still affected: A 10s sample contained 2407 short-lived After adding a short retry delay for failed AX registrations: The follow-up sample no longer showed the Dock AX-thread spiral. Fix ideaAdd a small negative cache/backoff in
This keeps successful app registration unchanged, but avoids repeatedly creating short-lived AX threads for the same failing app during polling. A separate draft PR with the minimal patch is planned. This report and the draft patch were prepared with Codex under my supervision. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
|
Draft PR with the minimal fix is now open: #2085 |
Beta Was this translation helpful? Give feedback.
-
|
@Knapsack44 is the behavior I describe in #2095 same as what you observed? I am the author of AeroMux and I saw this happen too. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the pointer. This may be related, but I do not think we can confirm from #2095 alone that it is the exact same root cause. On my system, Eerobox is also running. The concrete symptom I observed was high AeroSpace CPU, and the sample showed repeated failed AX app registration retries through:
The sample also showed many short-lived So AeroMux/Eerobox-style polling may be an amplifier: if read-only CLI calls become slow because AeroSpace is stuck retrying failed AX registration, CLI client processes can accumulate and make the system look like it has "too many aerospace processes". To verify whether #2095 is the same issue, the useful data would be:
If those signatures are present, I would treat it as the same root cause. If not, it may still be an adjacent polling/backpressure issue in the AeroMux interaction. |
Beta Was this translation helpful? Give feedback.
-
|
Should be fixed in 0.21.0-Beta |
Beta Was this translation helpful? Give feedback.
Should be fixed in 0.21.0-Beta