Repository navigation
Conversation
Flapping Bluetooth devices can make bt-agent exit about every 15s; a 2s RestartSec tight-loops the journal. Lengthen the delay and cap the restart burst. Co-authored-by: AnPod <AnPod@users.noreply.github.com>
a57f813 to
cd48585
Compare
chessing234
left a comment
There was a problem hiding this comment.
please put the start-limit settings in the unit section.
| # Flapping Bluetooth devices can make bt-agent exit about every 15 s (#13487). | ||
| # A short RestartSec tight-loops the journal; back off and cap the burst. | ||
| RestartSec=15 | ||
| StartLimitIntervalSec=300 |
There was a problem hiding this comment.
please move StartLimitIntervalSec into [Unit]: systemd accepts that name only there (the legacy [Service] spelling is StartLimitInterval), so this line is ignored. with the normal 10-second limit interval and RestartSec=15, each restart falls outside the window and the intended eight-start cap never takes effect.
|
|
One concern with the start limit: systemd's restart backoff (v254+) gets rid of the journal spam without ever giving up: [Unit]
# no StartLimit* overrides
[Service]
Restart=on-failure
RestartSec=2
RestartSteps=6
RestartMaxDelaySec=120That ramps the delay from 2 s to 120 s while the device keeps flapping, then goes back to a quick restart once the agent stays up. The |
|
Reviewed at f027fdf. The classification is unsettled, so this has not gone further yet, and nothing has been run on a worker. Two models classified it separately and disagreed. Claude Opus 5.5 read it as a bug fix: on One thing for the author in the meantime: the description still lists Waiting on the maintainer to settle the classification. |
|
Thanks, f027fdf does exactly that: |
Summary
Fixes #13487: a flapping Bluetooth device can make
bt-agentexit about every 15s. With a flatRestartSec=2, the user journal tight-loops for hours.Changes
default/systemd/user/bt-agent.service: keepRestartSec=2but addRestartSteps=6/RestartMaxDelaySec=120, so repeated restarts back off up to two minutes instead of retrying every 2 seconds.StartLimit*override, so a flapping device never leaves the unit stuck infailedand pairing keeps working.test/shell.d/systemd-test.shchecks the backoff settings and that noStartLimit*setting is added.Test plan
./test/shell.d/systemd-test.sh