Skip to content

fix(service): avoid background throttling on macOS - #1694

Merged
PsiACE merged 1 commit into
oceanbase:masterfrom
sunlight798:fix_macOS
Sep 21, 2026
Merged

PsiACE merged 1 commit into
oceanbase:masterfrom
sunlight798:fix_macOS

Conversation

@sunlight798

Copy link
Copy Markdown
Contributor

Which issue or RFC does this PR close?

Closes #1571.

Rationale for this change

The macOS native service intermittently exceeds its 30-second startup deadline. Failure snapshots show a running LaunchAgent with no listener, while process samples show Python imports and filesystem I/O still in progress.

The evidence points to resource throttling from ProcessType=Background. The personal Server handles user requests and should use standard scheduling.

What changes are included in this PR?

  • Use ProcessType=Standard for macOS LaunchAgents.
  • Continue recognizing intact older Background definitions so they can be upgraded safely.
  • Reconcile native configuration changes even when service metadata is unchanged, while preserving repeated-install idempotency.
  • Add regression coverage for legacy compatibility, configuration reconciliation, and native upgrade/restart behavior.

Are there any user-facing changes?

macOS personal services use standard scheduling. Running powercontext service install upgrades an existing Background definition and reloads the service.

The 30-second startup timeout remains unchanged. No public API or persisted metadata format changes.

How was this change tested?

  • make check — passed.
  • uv run --locked prek run -a — passed.
  • Related service, bootstrap, environment, and diagnostic tests — 128 passed, 9 skipped.
  • Native lifecycle suite on macOS:
    • Source checkout with Python 3.13 — 6 passed, 1 skipped.
    • Built wheel in a fresh Python 3.12 environment — 6 passed, 1 skipped.
  • Local scheduling comparison: Background startup took 8.69/9.70 seconds; Standard took 2.68/1.64 seconds.

Validation was performed locally. CI for this change has not run yet.

AI usage statement

OpenAI Codex assisted

Use Standard scheduling for LaunchAgents and reconcile existing native settings while preserving install idempotency. Add regression coverage for compatible upgrades and the real launchd lifecycle.

Refs oceanbase#1571

@PsiACE PsiACE left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

totally lgtm

@PsiACE
PsiACE merged commit 94297e1 into oceanbase:master Sep 21, 2026
22 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.

bug: flaky macOS native service lifecycle test

2 participants