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

emqx / esockd / 607
67%
master: 67%

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

26 Aug 2026 12:59PM UTC coverage: 68.923%. First build
607

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

23 of 24 new or added lines in 4 files covered. (95.83%)

774 of 1123 relevant lines covered (68.92%)

201.14 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
96.39
src/esockd_limiter.erl
Jobs
ID Job ID Ran Files Coverage
1 607.1 26 Aug 2026 01:02PM UTC 22
68.89
GitHub Action Run
2 607.2 26 Aug 2026 01:02PM UTC 22
68.83
GitHub Action Run
3 607.3 26 Aug 2026 01:02PM UTC 22
68.83
GitHub Action Run
Source Files on build 607
  • 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 (#609)
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