Skip to content

dump truncated and stdout permanently broken on non-blocking fd #32

Description

@vxpyy9

When stdout is in non-blocking mode, the first large output written via std::cout is silently truncated and all subsequent output is suppressed for the rest of the session - std::cout ends up permanently in an error state.

  • first dump after connecting (any format, any datastore) prints, but is cut off in the middle
  • after that, every command produces no output - commands run, nothing appears

Proposed fix
Don't rely on std::cout for output on a possibly non-blocking fd. Route output through a helper that writes to the fd in bounded chunks, retrying on EINTR and EAGAIN/EWOULDBLOCK (via poll).

I'd like to fix this upstream, but since it touches output across the whole app, I'd rather check how you'd prefer to handle it before opening a PR: whether to replace each std::cout call individually, route all output through a single wrapper, or something else entirely. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions