Summary
On Linux, Jcode v0.67.1 can repeatedly open Polkit password prompts while a session is streaming. Dismissing or failing those prompts causes systemd-inhibit to exit, after which Jcode's 5-second reconciliation loop launches it again without a retry limit or backoff. On my system this repeated until PAM temporarily locked my account after three failures.
This occurred on a machine where automatic idle suspend is disabled on both AC power and battery. The machine had remained continuously awake for more than a week with no recorded suspend/resume events. Suspend is still technically available for explicit requests and lid-switch handling, so this is not a claim that systemd suspend is globally disabled.
Environment
- Jcode: v0.67.1
- Linux with systemd/logind and Polkit
- Automatic idle suspend disabled on both AC power and battery; systemd idle action set to ignore
[power].prevent_sleep_while_streaming was at its default value of true
org.freedesktop.login1.inhibit-block-sleep required authentication for the Jcode background process
Reproduction
-
Use a Linux setup where a background process requesting org.freedesktop.login1.inhibit-block-sleep requires Polkit authentication.
-
Leave the default setting enabled:
[power]
prevent_sleep_while_streaming = true
-
Start Jcode and run a turn so a session is actively streaming/processing.
-
Dismiss or fail the Polkit password prompt.
-
Observe that another prompt appears shortly afterward. Repeating this can trigger pam_faillock.
Observed behavior
Jcode launched:
systemd-inhibit --what=sleep:handle-lid-switch \
--who=jcode \
--why="Jcode is streaming or processing active work" \
--mode=block sleep 150
Redacted journal excerpts:
polkitd: Operator ... FAILED to authenticate to gain authorization for action org.freedesktop.login1.inhibit-block-sleep ...
pam_faillock(polkit-1:auth): Consecutive login failures for user <redacted> account temporarily locked
polkitd: Operator ... FAILED to authenticate ... [systemd-inhibit --what=sleep:handle-lid-switch ...]
The implementation reconciles every 5 seconds. A successful spawn() is recorded as an acquired handle before Polkit authorization completes; when authorization fails and the child exits, the next reconciliation starts a fresh helper. There is no authorization-specific failure handling or backoff:
Expected behavior
A best-effort power inhibitor should not repeatedly request authentication or risk locking the user's account. If inhibition is not authorized, Jcode should fail noninteractively and either disable inhibition for the process lifetime or use a bounded backoff/retry policy.
Possible approaches include passing systemd-inhibit --no-ask-password and treating its nonzero exit as unavailable, or otherwise preventing repeated interactive authorization attempts.
It may also be useful to avoid acquiring an inhibitor when all automatic idle-suspend mechanisms are disabled, if that can be detected reliably. Explicit and lid-triggered suspend would remain separate considerations.
Workaround
This stops the behavior:
[power]
prevent_sleep_while_streaming = false
JCODE_DISABLE_POWER_INHIBIT=1 is also documented as a force-disable override.
Related issue
#452 fixed the TUI ignoring prevent_sleep_while_streaming = false. That setting works in v0.67.1; this report concerns repeated authentication attempts when the default-enabled inhibitor cannot be authorized.
Summary
On Linux, Jcode v0.67.1 can repeatedly open Polkit password prompts while a session is streaming. Dismissing or failing those prompts causes
systemd-inhibitto exit, after which Jcode's 5-second reconciliation loop launches it again without a retry limit or backoff. On my system this repeated until PAM temporarily locked my account after three failures.This occurred on a machine where automatic idle suspend is disabled on both AC power and battery. The machine had remained continuously awake for more than a week with no recorded suspend/resume events. Suspend is still technically available for explicit requests and lid-switch handling, so this is not a claim that systemd suspend is globally disabled.
Environment
[power].prevent_sleep_while_streamingwas at its default value oftrueorg.freedesktop.login1.inhibit-block-sleeprequired authentication for the Jcode background processReproduction
Use a Linux setup where a background process requesting
org.freedesktop.login1.inhibit-block-sleeprequires Polkit authentication.Leave the default setting enabled:
Start Jcode and run a turn so a session is actively streaming/processing.
Dismiss or fail the Polkit password prompt.
Observe that another prompt appears shortly afterward. Repeating this can trigger
pam_faillock.Observed behavior
Jcode launched:
Redacted journal excerpts:
The implementation reconciles every 5 seconds. A successful
spawn()is recorded as an acquired handle before Polkit authorization completes; when authorization fails and the child exits, the next reconciliation starts a fresh helper. There is no authorization-specific failure handling or backoff:server.rs: 5-second reconciliation looppower_inhibit.rs: respawn after an exited helperpower_inhibit.rs:systemd-inhibitcommandExpected behavior
A best-effort power inhibitor should not repeatedly request authentication or risk locking the user's account. If inhibition is not authorized, Jcode should fail noninteractively and either disable inhibition for the process lifetime or use a bounded backoff/retry policy.
Possible approaches include passing
systemd-inhibit --no-ask-passwordand treating its nonzero exit as unavailable, or otherwise preventing repeated interactive authorization attempts.It may also be useful to avoid acquiring an inhibitor when all automatic idle-suspend mechanisms are disabled, if that can be detected reliably. Explicit and lid-triggered suspend would remain separate considerations.
Workaround
This stops the behavior:
JCODE_DISABLE_POWER_INHIBIT=1is also documented as a force-disable override.Related issue
#452 fixed the TUI ignoring
prevent_sleep_while_streaming = false. That setting works in v0.67.1; this report concerns repeated authentication attempts when the default-enabled inhibitor cannot be authorized.