Skip to content

Conversation

@echobt
Copy link
Contributor

@echobt echobt commented Jan 21, 2026

Description

This PR addresses an issue where setting watch_debounce_ms to 0 caused 100% CPU usage due to a tight polling loop. A minimum debounce value of 10ms is now enforced to prevent this denial of service condition.

Fix

  • Added validation in set_watch_debounce in src/config.rs to reject values less than 10ms.
  • Setting 0 now returns a clear error message instead of causing high CPU usage.

Testing

  • Validated that vgrep config set watch-debounce 0 now fails with "Watch debounce must be at least 10ms".
  • Ran existing tests to ensure no regressions.

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.

3 participants