Skip to content

Line buffering appears broken in 15.0.0 #3194

@lespea

Description

@lespea

Please tick this box to confirm you have reviewed the above.

  • I have a different issue.

What version of ripgrep are you using?

ripgrep 15.0.0

features:+pcre2
simd(compile):+SSE2,+SSSE3,+AVX2
simd(runtime):+SSE2,+SSSE3,+AVX2

PCRE2 10.45 is available (JIT is available)

How did you install ripgrep?

Bug appears when built locally with Cargo as well as the binaries provided on the release page

What operating system are you using ripgrep on?

Arch Linux -- kernel 6.17.3

Describe your bug.

I've been using ripgrep to filter journalctl output in follow mode for years and thus need the --line-buffered option otherwise nothing is output since stdin doesn't close. With the latest release that switch doesn't appear to be having any affect.

What are the steps to reproduce the behavior?

No output:

journalctl -n5 -f | ./rg --no-config --line-buffered  'Oct'

Does produce some output -- I assume this is because the "block buffer" is getting full?

journalctl -n5000 -f | ./rg --no-config --line-buffered  'Oct'

When run with < 15.0.0 each line that is matched is output as soon as it's printed by journalctl. Obviously you'll have to adjust the search to match whatever's in your logs.

What is the actual behavior?

Same as "steps to reproduce"

What is the expected behavior?

Match lines (or inverse matches with -v) should be output as soon as they're output by the pipe

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions