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

emqx / esockd / 609
67%
master: 67%

Build:
Build:
LAST BUILD BRANCH: feat/conn-rate-token-refund
DEFAULT BRANCH: master
Ran 27 Aug 2026 09:33AM 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

27 Aug 2026 08:49AM UTC coverage: 69.217%. First build
609

Pull #228

github

terry-xiaoyu
feat: wait_with_first_data - probe first bytes inside esockd's wait

Move the "first bytes or already-dead socket" detection for plain-TCP and
proxy-protocol connections into esockd's wait machinery, where the proxy
header and TLS handshake upgrade funs already run:

- esockd_transport:wait_with_first_data/1 runs the upgrade funs, then does a
  zero-timeout recv(Sock, 0, 0) on TCP-ish sockets (TLS skipped: the
  handshake already engaged the client, and handshake-stage deaths are
  handled by the upgrade funs):
    {ok, Sock, Data}  first bytes already in hand, returned as a binary;
    {ok, Sock}        peer silent but alive: caller activates as usual;
    closed/econnreset peer already gone before sending anything: exit with
                      the {shutdown, {pre_establishment, _}} marker, the
                      same mechanism as the TLS handshake marker, so the
                      caller never sees this case and does not need to know
                      the marker shape (conn-rate token refund design).
  Only closed/econnreset are treated as peer-gone: other errors (einval on
  an active-mode socket, timeout, ...) fall back to the normal path.
- closed is normalized to tcp_closed to match the active-mode
  {tcp_closed, _} message tag, keeping the shutdown_count key unchanged.
- wait/1 is unchanged for consumers that do not opt in (STOMP, exproto).

Tests: real-socket cases for data return, FIN/RST marked exit, silent
fallback, TLS skip, proxy inner-socket probe, upgrade-fun chains.

The emqx side (paired commit) switches emqx_connection:init to this API.
Pull Request #228: feat: refund connection-rate token for connections that die before engaging

35 of 38 new or added lines in 4 files covered. (92.11%)

787 of 1137 relevant lines covered (69.22%)

198.91 hits per line

Uncovered Changes

Lines Coverage ∆ File
2
55.49
src/esockd_transport.erl
1
96.39
src/esockd_limiter.erl
Jobs
ID Job ID Ran Files Coverage
1 609.1 27 Aug 2026 09:33AM UTC 22
69.13
GitHub Action Run
2 609.2 27 Aug 2026 09:34AM UTC 22
69.13
GitHub Action Run
3 609.3 27 Aug 2026 09:34AM UTC 22
69.19
GitHub Action Run
Source Files on build 609
  • 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 (#611)
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