Skip to content

NITRO_BUN_IDLE_TIMEOUT=0 is ignored #4189

Closed

Description

@IlyaSemenov

Environment

Reproduction

The bug is very obvious. If you absolutely insist I can make a reproduction, but the problem is immediately clear by looking at the code, it uses || which doesn't account for 0.

Describe the bug

NITRO_BUN_IDLE_TIMEOUT=0 is treated as it's undefined (due to a flaw in implementation) and is effectively ignored. As such, the default timeout of 10 seconds is used.

This is incorrect; 0 is a valid value that disables the timeout entirely. Bun documentation specifically advises to use 0 for streaming & SSE:

Streaming & Server-Sent Events — The idle timer applies while a response is being streamed. If your stream goes quiet for longer than idleTimeout, the connection will be closed mid-response. For long-lived streams, disable the timeout for that request with server.timeout(req, 0).

Additional context

The fix is trivial, I will submit the PR.

Logs

Activity

  1. added
    pending triage
    on Apr 7, 2026
  2. parallax1s commented on Apr 8, 2026

    @parallax1s

    I’d like to take this one.

    I can reproduce the behavior: NITRO_BUN_IDLE_TIMEOUT=0 is treated as falsy and falls back to the default timeout.

    Proposed fix:

    • preserve 0 as a valid value (use nullish/explicit numeric handling instead of falsy fallback)
    • add regression tests for undefined, 0, and non-zero values

    If this direction looks good, I’ll open a draft PR.

  3. IlyaSemenov commented on Apr 9, 2026

    @IlyaSemenov
    Author

    @parallax1s I've opened the PR along with the issue, it's linked above: #4190. Anything wrong with it, why would you want to open an another one?

    Granted, the PR doesn't have a regression test, but I didn't find a respective place to add one, and didn't want to grow 100-line testing harness for the sake of essentially testing Number.isNaN.

  4. added
    bug
    and removed
    pending triage
    on Sep 2, 2026
  5. pi0 commented on Oct 15, 2026

    @pi0
    Member
  6. added theissue type on Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions