Skip to content

Missing lines when using readline Interface as AsyncIterable #28565

Description

@amcheshire
  • Version: v12.6.0
  • Platform: Darwin Admins-MacBook-Pro-6.local 18.6.0 Darwin Kernel Version 18.6.0: Thu Apr 25 23:16:27 PDT 2019; root:xnu-4903.261.4~2/RELEASE_X86_64 x86_64
  • Subsystem: readline

We were using readline to convert a stream that gives bytes to an AsyncIterable of lines. We did this by using something like:

const iterableOfLines = readline.createInterface({ input: streamOfBytes })

We would then use this as an AsyncIterable (which looks like it should be supported) and write it to a file, but there would sometimes be lines missing. The number of lines missing was inconsistent and we couldn't identify any patterns relating the lines that were missing. They were not different from the rest in any way, they were not always the first or last lines, etc.

Unfortunately, it's hard for me to tell you more because we were unable to write an isolated test that would reliably show this behavior (we noticed it in production).

We are confident that the bug is in readline because we replaced the use of it with our own custom function that would convert the bytes to lines, and we consistently get all of the lines every time.

Activity

  1. added
    readlineIssues and PRs related to the built-in readline module.
    on Jul 8, 2019
  2. jasnell commented on Jun 26, 2020

    @jasnell
    Member

    @nodejs/stream @BridgeAR ... any ideas?

  3. jfriend00 commented on Jul 13, 2020

    @jfriend00

    Probably related to #33463.

  4. github-actions commented on Jun 27, 2026

    @github-actions
    Contributor

    This issue has been marked as stale due to 210 days of inactivity.
    It will be automatically closed in 30 days if no further activity occurs. If this is still relevant, please leave a comment or update it to keep it open.

  5. added
    staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.
    on Jun 27, 2026
  6. github-actions commented on Jul 28, 2026

    @github-actions
    Contributor

    This issue has been automatically closed after 30 days of inactivity following its stale status (no activity for a total of 120 days).
    If this is still relevant, feel free to reopen it or leave a comment with additional details so we can continue the discussion.

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

    readlineIssues and PRs related to the built-in readline module.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions