DetectTunnels blocks on a FIFO under wiki/, hanging brain_update and brain_write #174

Closed
opened 2026-10-05 05:03:30 +00:00 by mathias · 0 comments
Owner

Source: the PR #170 reviews, rounds 1 and 2 (comments 15038 and 15040). This was already true on main.

wikiUpkeep calls AutoTunnel, which calls DetectTunnels. DetectTunnels (via readTitleAndCreated) opens every wiki .md with a blocking os.Open. A FIFO named *.md anywhere under wiki/ therefore hangs a successful brain_update or brain_write with no deadline.

A FIFO can be planted by a Syncthing peer or by a local process. The symlinkguard tripwire does not remove FIFOs.

Fix: walk and read through brainfs.WalkRegular/ReadRegular, which skip non-regular files and open with O_NONBLOCK. This is the same treatment as the #157 slices.

Done when: a test with a no-reader FIFO under wiki/ shows that DetectTunnels returns within a timeout, and the test goes red with the blocking open restored.


Created via git-mcp on behalf of @mathias

**Source:** the PR #170 reviews, rounds 1 and 2 (comments 15038 and 15040). This was already true on main. `wikiUpkeep` calls `AutoTunnel`, which calls `DetectTunnels`. `DetectTunnels` (via `readTitleAndCreated`) opens every wiki `.md` with a blocking `os.Open`. A FIFO named `*.md` anywhere under `wiki/` therefore hangs a successful `brain_update` or `brain_write` with no deadline. A FIFO can be planted by a Syncthing peer or by a local process. The symlinkguard tripwire does not remove FIFOs. **Fix:** walk and read through `brainfs.WalkRegular`/`ReadRegular`, which skip non-regular files and open with `O_NONBLOCK`. This is the same treatment as the #157 slices. **Done when:** a test with a no-reader FIFO under `wiki/` shows that `DetectTunnels` returns within a timeout, and the test goes red with the blocking open restored. --- _Created via git-mcp on behalf of @mathias_
mathias added the risk/medium label 2026-10-05 05:03:30 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mathias/hyperguild#174