• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

emqx / esockd / 578
67%
master: 67%

Build:
Build:
LAST BUILD BRANCH: feat/conn-rate-token-refund
DEFAULT BRANCH: master
Ran 20 Aug 2026 08:07AM UTC
Jobs 3
Files 22
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

20 Aug 2026 07:31AM UTC coverage: 67.55%. First build
578

Pull #225

github

terry-xiaoyu
fix: verify countdown timer liveness and re-arm it if dead

The countdown timer was trusted through the `timer` state field alone:
branches that found the field set did nothing, so nothing distinguished
"a timer is armed" from "the state says a timer is armed". If the timer
ever died (cancelled externally, or its reference replaced while a tick
was still in flight) while the field kept pointing at it, the countdown
froze silently - the same permanent-stall failure mode as the schedule
bug fixed previously.

Make the invariant structural instead of assumed:

- arm_countdown_timer/2: the single arming point, clamping the timeout
  to at least 1ms (start_timer crashes on a negative timeout and arms
  a never-firing timer on zero) and arming only while buckets exist, so
  an idle limiter no longer ticks once per second forever
- ensure_countdown_timer/1: verifies the reference against
  erlang:read_timer/1 - the actual liveness, not the field - and re-arms
  a dead timer; every callback touching the countdown map now ends here
  (create, update, delete, and every countdown tick)
- a stale countdown tick (reference no longer matching the state)
  re-establishes the invariant instead of falling into the unexpected
  message log

Tests: externally cancel the timer and verify a config touch re-arms it
and buckets keep refilling; inject stale ticks against both a live and
a dead timer; verify no timer exists without buckets and that the last
pending tick winds down after the final delete.
Pull Request #225: fix: verify countdown timer liveness and re-arm it if dead

11 of 11 new or added lines in 1 file covered. (100.0%)

714 of 1057 relevant lines covered (67.55%)

206.48 hits per line

Jobs
ID Job ID Ran Files Coverage
1 578.1 20 Aug 2026 08:07AM UTC 22
67.46
GitHub Action Run
2 578.2 20 Aug 2026 08:07AM UTC 22
67.52
GitHub Action Run
3 578.3 20 Aug 2026 08:07AM UTC 22
67.46
GitHub Action Run
Source Files on build 578
  • Tree
  • List 22
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #225
  • Next Build on (#580)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc