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

safe-global / safe-events-service / 36412316020
86%

Build:
DEFAULT BRANCH: main
Ran 28 Sep 2026 10:54AM UTC
Jobs 2
Files 47
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

28 Sep 2026 10:52AM UTC coverage: 85.526% (-1.9%) from 87.431%
36412316020

push

github

web-flow
perf: Reuse HTTP connections and cache DNS on webhook delivery (#603)

* perf: Reuse HTTP connections and cache DNS on webhook delivery

undici caches no DNS and closes idle sockets after 4s, so most webhook
deliveries paid a full DNS + TCP + TLS connect. Compose the DNS cache
interceptor and raise the keep-alive so sockets survive between events.
clientTtl bounds connection lifetime, so DNS and load balancer changes
still get picked up.

The pool stays uncapped, which matches current behaviour. A cap does not
reduce connects, the keep-alive does, and it would queue requests behind
a slow host on top of the retry chain awaited inline before the ack.
Concurrency per host is already bounded by AMQP_PREFETCH_MESSAGES.
HTTP_CONNECTIONS_PER_HOST is there to cap it if file descriptor pressure
shows up.

Measured against a local server:
- host not advertising keep-alive, one request every 6s: 4 connections
  before, 1 after
- host with 300ms latency, 10 rounds of 100 concurrent: 100 connections
  for 1000 requests, all reused after the first round

Two limits worth knowing. A host answering `Keep-Alive: timeout=N`
overrides the client setting, so the gain only applies to hosts that
advertise nothing or a high value. Failed lookups are not cached, so
hosts failing with ENOTFOUND keep resolving on every attempt.

* fix: Guard numeric HTTP config against invalid values

Number() on an env var returns NaN for anything that does not parse, and
NaN never reaches undici as an error. Agent stores options through
util.deepClone, which is JSON based, so JSON.stringify(NaN) turns into
null and undici applies its own default instead.

Effects of a typo before this change:
- HTTP_MAX_RETRIES: comparisons against NaN are always false, so the
  retry count never passes the limit and the request retries forever.
  Measured against a failing endpoint: 463 requests in 5s, still going.
- HTTP_DNS_CACHE_TTL: the interceptor accepts NaN, and the expiry check
  is always false, s... (continued)

289 of 354 branches covered (81.64%)

Branch coverage included in aggregate %.

18 of 27 new or added lines in 1 file covered. (66.67%)

686 of 786 relevant lines covered (87.28%)

20.76 hits per line

Uncovered Changes

Lines Coverage ∆ File
9
55.38
-44.62% src/modules/webhook/webhook.module.ts
Jobs
ID Job ID Ran Files Coverage
1 run-test:cov - 36412316020.1 28 Sep 2026 10:54AM UTC 92
85.14
GitHub Action Run
2 run-test:e2e:cov - 36412316020.2 28 Sep 2026 10:54AM UTC 88
60.51
GitHub Action Run
Source Files on build 36412316020
  • Tree
  • List 47
  • Changed 24
  • Source Changed 1
  • Coverage Changed 24
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #36412316020
  • 321329bc on github
  • Prev Build on main (#36003294823)
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