Skip to content

fix(maintenance): systemd scope Nice=19 property breaks resource isolation #712

Closed as not planned

Description

@Sinity

Problem

_run_in_systemd_scope() in polylogue/maintenance/resources.py:199-203 calls systemd-run --user --scope --property=Nice=19. When systemd-run rejects the Nice property (some systemd builds/configs don't allow unprivileged nice in user scopes), the function raises SystemExit(nonzero) which bypasses the except ScopeLaunchUnavailableError handler and kills the process.

The error: Unknown assignment: Nice=19 from systemd-run, exit code 1, then SystemExit(1) propagates uncaught through the call stack.

Acceptance Criteria

  • When systemd-run fails, _run_in_systemd_scope raises ScopeLaunchUnavailableError instead of SystemExit, so the caller falls through to _apply_process_demotion (process-local os.nice() + ionice)
  • --resource-mode auto (the default) gracefully degrades to process-local demotion
  • --resource-mode scope reports the unavailability clearly

Activity

  1. added
    type:fix
    area:core
    on May 2, 2026
  2. Sinity commented on May 2, 2026

    @Sinity
    OwnerAuthor

    Closing: with the daemon architecture (#717), Polylogue CLI never executes heavy work and --resource-mode was removed (#715). systemd Nice=19 on the daemon service is a Sinnix host concern (polylogued.service unit), not a Polylogue product concern. The Polylogue product should not ship systemd-specific resource properties.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:coretype:fix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions