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

emqx / esockd / 599
67%
master: 67%

Build:
Build:
LAST BUILD BRANCH: feat/conn-rate-token-refund
DEFAULT BRANCH: master
Ran 25 Aug 2026 03:42PM 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

25 Aug 2026 03:39PM UTC coverage: 68.956%. First build
599

Pull #228

github

terry-xiaoyu
feat: refund connection-rate token for connections that die before engaging

A connection whose peer FIN/RSTs before any application data was exchanged
consumes a connection-rate token at accept but never engages: under a storm
of dead sockets the limiter bucket can be driven into debt, pausing every
acceptor even though no real connection ever established.

Refund such tokens:
- esockd_limiter:refund/1 returns one token only while the bucket is in debt
  (tokens < 0), so no free tokens are ever created; missing buckets are no-op.
- esockd_transport:upgrade/2 exits the connection process with the
  {shutdown, {pre_establishment, Reason}} marker when an upgrade fun (e.g.
  the TLS handshake) fails with a peer-gone reason (closed/einval/enotconn),
  so TLS dead connections are detected by esockd itself, without any upper
  layer cooperation.
- esockd_connection_sup unwraps the marker: the inner reason is counted in
  shutdown_count as before, and the token is refunded. set_conn_limiter/2
  hands the limiter bucket to the sup (process dictionary, hot-upgrade safe).
- esockd_listener_sup wires the bucket to the connection sup at listener
  start and on set_max_conn_rate reconfiguration.

The emqx side (emqx_connection) produces the same marker for plain-TCP
connections that die before their first bytes (see the paired PR).
Pull Request #228: feat: refund connection-rate token for connections that die before engaging

21 of 22 new or added lines in 4 files covered. (95.45%)

773 of 1121 relevant lines covered (68.96%)

201.13 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
65.03
src/esockd_connection_sup.erl
Jobs
ID Job ID Ran Files Coverage
1 599.1 25 Aug 2026 03:42PM UTC 22
68.87
GitHub Action Run
2 599.2 25 Aug 2026 03:42PM UTC 22
68.78
GitHub Action Run
3 599.3 25 Aug 2026 03:42PM UTC 22
68.93
GitHub Action Run
Source Files on build 599
  • Tree
  • List 22
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #228
  • Next Build on (#601)
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