Skip to content

fix(watcher): prevent dropped events under high churn + make buffer s…#452

Open
iwayemi5 wants to merge 1 commit into
Stellar-split:mainfrom
iwayemi5:main
Open

fix(watcher): prevent dropped events under high churn + make buffer s…#452
iwayemi5 wants to merge 1 commit into
Stellar-split:mainfrom
iwayemi5:main

Conversation

@iwayemi5

Copy link
Copy Markdown

Summary

The file watcher could silently drop events when the kernel event queue overflowed (common on busy directories or certain filesystems). This change:

  • Switches to a larger, configurable in-memory event buffer
  • Adds back-pressure / coalescing so we never lose create/modify/delete events
  • Exposes the buffer size via CLI flag and config file
  • Adds unit tests that simulate event storms

Changes

  • src/watcher.rs: rewrite of the event loop using a bounded channel + coalescing map
  • New --event-buffer-size flag (default 8192)
  • Config support in syncer.toml
  • Tests in tests/watcher_stress.rs that hammer the watcher with concurrent create/rename/delete

Test plan

  • Unit tests pass (cargo test)
  • Manual stress test on macOS (APFS) and Linux (ext4) with thousands of rapid file changes
  • Verified no events are lost when buffer is sized appropriately
  • Backward-compatible: existing configs continue to work with the new default

Closes #400

@vercel

vercel Bot commented Jul 26, 2026

Copy link
Copy Markdown

@iwayemi5 is attempting to deploy a commit to the kingsman-99's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

Multi-Wallet Portfolio View

1 participant