Repository navigation
tail: fix following redirected stdin - #9093
mattsu2020 wants to merge 1 commit into
Conversation
|
GNU testsuite comparison: |
|
The CI fail seems unrelated. Could you squash your commits, for us to review your work better, and prepare for the future merge? |
5e1957f to
7f3ecc7
Compare
|
GNU testsuite comparison: |
Done |
|
GNU testsuite comparison: |
1 similar comment
|
GNU testsuite comparison: |
beab632 to
05bdc56
Compare
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
ce85f5c to
b50b701
Compare
|
GNU testsuite comparison: |
b50b701 to
ab579ed
Compare
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
| return Ok(()); | ||
| } | ||
|
|
||
| if path.metadata().map(|meta| meta.is_dir()).unwrap_or(false) { |
There was a problem hiding this comment.
tail_file already handles directories, this duplicates it. could we just let it go there?
| } | ||
|
|
||
| #[allow(clippy::unnecessary_wraps)] | ||
| pub fn set_stdin_key<P: Into<PathBuf>>(&mut self, _path: P) -> UResult<()> { |
There was a problem hiding this comment.
i am really not a fan of this function.
it probably demonstrates a refactor
Merging this PR will regress 1 benchmark
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ❌ | three_39_bit_primes |
591.3 ms | 774.5 ms | -23.65% |
| ⚡ | five_38_bit_primes |
2.1 s | 1.8 s | +18.77% |
| ⚡ | thirteen_39_bit_primes |
9.6 s | 8.6 s | +12.12% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing mattsu2020:tail_f_fix (4ebd4de) with main (01a8fc0)
Footnotes
-
333 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
4ebd4de to
3b4a91f
Compare
3b4a91f to
0926e9f
Compare
|
GNU testsuite comparison: |
|
You need to annotate the test not to run on wasi |
| let mut paths: Vec<PathBuf> = vec![]; | ||
| let display_name = self.files.get(event_path).display_name.clone(); | ||
|
|
||
| if self.follow_descriptor() |
There was a problem hiding this comment.
this early return skips the whole match below for -f. could it go into the existing arms instead of adding a parallel path?
|
|
||
| // With -f, sleep for approximately N seconds (default 1.0) between iterations; | ||
| // We wake up if Notify sends an Event or if we wait more than `sleep_sec`. | ||
| let wait = if !observer.use_polling |
There was a problem hiding this comment.
do we really need a second timer next to timeout_counter? this is getting hard to follow
|
thanks for picking this up! This does more than fix |
|
sorry but it needs to be rebased, and a bunch of jobs are failing |
9c7e4b9 to
6c3539b
Compare
6c3539b to
784c4f3
Compare
tail -f < fileexits after the initial read instead of following further appends. Resolve and watch redirected stdin at read time and reuse its open descriptor, preserving the input offset and following the same file after renames, replacements, or truncation.Add regression coverage for redirected stdin and descriptor following, with unsupported cases skipped on WASI.
Closes #7614