Skip to content

Agent installer: run the launchd agent at standard priority - #25

Merged
danielehrhardt merged 1 commit into
mainfrom
fix/agent-launchd-priority
Nov 19, 2026
Merged

danielehrhardt merged 1 commit into
mainfrom
fix/agent-launchd-priority

Conversation

@danielehrhardt

Copy link
Copy Markdown
Contributor

Problem

The macOS installer registers the agent with ProcessType=Background. launchd then runs it (and every CLI session it spawns) in the lowest scheduling band. On a Mac under load (load average around 45 on 14 cores) the agent process did not get scheduled for about 100 seconds: no check-in reached the server, the agent was marked offline after 45 seconds and its two running jobs were requeued. The results it reported afterwards were rejected with HTTP 409.

Change

Use ProcessType=Standard in the generated LaunchAgent.

Verified

  • Two production agents switched to Standard by hand (process priority 4 -> 20).
  • On the machine that had stalled, the following run of 60+ jobs under the same load completed without an offline event or requeue.

Existing installs keep their plist until they are reinstalled.

A Background launchd job runs in the lowest scheduling band. On a busy Mac the
agent process starved for over a minute, missed its check-ins, was marked
offline and had its running jobs requeued.
@danielehrhardt
danielehrhardt merged commit 4a9cfb0 into main Nov 19, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant