summaryrefslogtreecommitdiff
path: root/internal/askcli/command_edit.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-06-11 08:40:10 +0300
committerPaul Buetow <paul@buetow.org>2026-06-11 08:40:10 +0300
commit133ef49de26ae251c2c86417f9c673ebc7166f76 (patch)
treebfcf2e105f992cc06409f193873875e2b7ea18e6 /internal/askcli/command_edit.go
parentdc8f0ab28276fac6aa16c0cf3591c322367036b7 (diff)
Fix unsafe time.Timer.Reset on active timers in runlock and filelock
Both filelock.AcquireExclusive and askcli.waitOrAcquireAskLockFD created a single time.Timer and called Reset() on it each retry iteration before it had necessarily fired. Per the Go timer API, Reset()-ing a timer that may still be pending is unsafe: a stale value can already be queued on the channel, causing a spurious early wake-up. Replace the reused-timer + Reset() pattern with a fresh time.After(...) per loop iteration, which guarantees a clean full retry interval (or context cancellation) every time and removes the reuse-while-active hazard. Dropped the now-unused *time.Timer parameter from waitOrAcquireAskLockFD and introduced named retry-interval constants. Add a context-cancel-while-blocked test for the runlock retry loop. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'internal/askcli/command_edit.go')
0 files changed, 0 insertions, 0 deletions