Skip to content

ChunkerFixed: ignore posix_fadvise() errors, e.g. ESPIPE for a FIFO (1.2-maint) - #10570

Merged
ThomasWaldmann merged 1 commit into
borgbackup:1.2-maintfrom
ThomasWaldmann:fixed-chunker-fadvise-12
Oct 29, 2026
Merged

ThomasWaldmann merged 1 commit into
borgbackup:1.2-maintfrom
ThomasWaldmann:fixed-chunker-fadvise-12

Conversation

@ThomasWaldmann

Copy link
Copy Markdown
Member

Port of the 1.4-maint fix. dread() in chunker.pyx called os.posix_fadvise() on the file handle after each read. That fails with ESPIPE for a pipe / FIFO (e.g. on Linux and FreeBSD), so with borg create --read-special --chunker-params fixed,... borg could not read a FIFO at all and skipped it with an error.

posix_fadvise() is only an optimization of the page cache usage, so its errors are now ignored, like safe_fadvise() does. safe_fadvise() itself can not be imported in chunker.pyx, due to an import cycle on Linux (helpers -> chunker -> platform -> platform.linux -> helpers). master uses safe_fadvise() since 2025 and is not affected; its test PR is #10568.

Tests: the new test_chunkify_pipe chunks a real pipe's file handle with ChunkerFixed. On Linux it failed before this fix with OSError: [Errno 29] Illegal seek and passes with it.

See #10565. The short-read fix for the same scenario was merged in #10563 (1.4-maint) / #10564 (1.2-maint).

🤖 Generated with Claude Code

posix_fadvise() fails with ESPIPE for a pipe / FIFO (e.g. on Linux and
FreeBSD), so "borg create --read-special" with the fixed chunker could
not read a FIFO at all: the OSError made borg skip it with an error.

posix_fadvise() is only an optimization of the cache usage, so ignore
its errors, like safe_fadvise() does (it can not be used here due to an
import cycle on Linux). master uses safe_fadvise since 2025.

Also add a test reading from a real pipe.

See borgbackup#10565.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ThomasWaldmann
ThomasWaldmann merged commit d1dfa61 into borgbackup:1.2-maint Oct 29, 2026
9 of 10 checks passed
@ThomasWaldmann
ThomasWaldmann deleted the fixed-chunker-fadvise-12 branch October 29, 2026 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant