Skip to content

fix(kms): raise Bun auth idleTimeout above the KMS webhook timeout - #1460

Merged
Leechael merged 2 commits into
nextfrom
fix/kms-auth-api-bun-idle-timeout
Oct 22, 2026
Merged

Leechael merged 2 commits into
nextfrom
fix/kms-auth-api-bun-idle-timeout

Conversation

@Leechael

Copy link
Copy Markdown
Collaborator

Summary

Bun.serve defaults idleTimeout to 10s and closes the socket while the auth handler is still awaiting a slow eth_call. That shows up on KMS GetMeta as connection closed before message completed, usually after ~10s, with no matching auth-api request log.

Set idleTimeout: 255 (Bun's documented maximum) on auth-eth-bun, auth-mock, and auth-simple so the KMS client's 60s webhook timeout fires first.

Evidence

  • Production symptom: failures cluster at ~10s, auth-api often has no batch line for the failed call.
  • Local repro: default Bun idle timeout fails a 12s handler; idleTimeout: 30/255 succeeds.
  • bunx vitest run in auth-eth-bun: 24 passed.

Test plan

  • cd dstack/kms/auth-eth-bun && bunx vitest run
  • Redeploy/restart auth-api and confirm GetMeta no longer fails at ~10s with connection closed before message completed
  • Slow/unavailable upstream RPC should now surface as KMS webhook timeout (~60s) or auth-api 500, not Bun idle close

Bun.serve defaults idleTimeout to 10s and closes the socket while the
handler is still awaiting eth_call. That surfaces on GetMeta as
"connection closed before message completed". Set idleTimeout to Bun's
255s maximum so the KMS client's 60s webhook timeout fires first.

Signed-off-by: Leechael Yim <yanleech@gmail.com>
@Leechael
Leechael force-pushed the fix/kms-auth-api-bun-idle-timeout branch from eed0885 to 87412bc Compare October 21, 2026 14:51
@Leechael
Leechael merged commit ce2e369 into next Oct 22, 2026
12 checks passed
@Leechael
Leechael deleted the fix/kms-auth-api-bun-idle-timeout branch October 22, 2026 04:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant