Skip to content

fix(volumemgr): floor deferContentDelete ticker at 1 second#5894

Open
akaouris wants to merge 1 commit intolf-edge:masterfrom
akaouris:content-tree-delete-defer
Open

fix(volumemgr): floor deferContentDelete ticker at 1 second#5894
akaouris wants to merge 1 commit intolf-edge:masterfrom
akaouris:content-tree-delete-defer

Conversation

@akaouris
Copy link
Copy Markdown
Contributor

@akaouris akaouris commented May 4, 2026

Description

Pushing a value in 1..9 for the timer.defer.content.delete global setting
(via zcli edge-node update --config="timer.defer.content.delete:N" or
equivalent) crashes zedbox and triggers a watchdog reboot of the device. This was reproduced in an edge node running 16.0.0-lts-kvm-amd64.

maybeUpdateConfigItems in volumemgr computes the ticker interval as
ctx.deferContentDelete / 10, where deferContentDelete is uint32. For
any value below 10 the integer division truncates to 0, and
time.NewTicker(0) panics with non-positive interval for NewTicker.
Because all pillar agents share the zedbox process, this single panic
takes down every microservice and the EVE watchdog reboots the node.

Fix

Floor the ticker period at 1 second:

seconds := max(uint32(1), ctx.deferContentDelete/10)
ctx.deferDelete = time.NewTicker(time.Duration(seconds) * time.Second)

How to test and validate this PR

On a running node:

zcli edge-node update <node> --config="timer.defer.content.delete:3"

Followed later by:

Watchdog report for IMGA EVE version 16.0.0-lts-kvm-amd64 ... 3 /run/zedbox.pid

Changelog notes

  • fix(volumemgr): floor deferContentDelete ticker at 1 second

PR Backports

Should be backported to:

  • 16.0-stable

Checklist

  • I've provided a proper description
  • I've added the proper documentation
  • I've tested my PR on amd64 device
  • I've tested my PR on arm64 device
  • I've written the test verification instructions
  • I've set the proper labels to this PR

The tests were done only on x86 device.

And the last but not least:

  • I've checked the boxes above, or I've provided a good reason why I didn't
    check them.

Please, check the boxes above after submitting the PR in interactive mode.

time.NewTicker(0) panics with "non-positive interval for NewTicker".
ctx.deferContentDelete is uint32, so the existing / 10 truncated values
1..9 to 0 and crashed zedbox, triggering a watchdog reboot.

Signed-off-by: Alexandros Kaouris <a.kaouris@speedcast.com>
@akaouris akaouris requested a review from rouming as a code owner May 4, 2026 15:24
Comment thread pkg/pillar/cmd/volumemgr/volumemgr.go
Copy link
Copy Markdown
Contributor

@eriknordmark eriknordmark left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for fixing this @akaouris

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.

3 participants