Skip to content

[BUG] watch_debounce_ms = 0 Causes High CPU Usage #213

@EnthusiasticTech

Description

@EnthusiasticTech

Project

vgrep

Description

Setting watch_debounce_ms to 0 is accepted without validation. Since this value is incorrectly used as poll_interval (see Bug #3), a value of 0 causes:

  • Constant filesystem polling with no delay
  • 100% CPU usage on one core
  • System resource exhaustion
  • Effective denial of service

Error Message

Debug Logs

System Information

Bounty Version: 0.1.0
OS: Ubuntu 24.04 LTS
CPU: AMD EPYC-Genoa Processor (8 cores)
RAM: 15 GB

Screenshots

No response

Steps to Reproduce

  1. Set debounce to 0: vgrep config set watch-debounce 0
  2. Start file watcher: vgrep watch .
  3. Monitor CPU usage: top or htop
  4. Observe 100% CPU usage on vgrep process

Expected Behavior

  1. Minimum debounce value should be enforced (e.g., >= 10ms)
  2. Setting 0 should return error or use sensible minimum
  3. Poll interval should be separate from debounce

Actual Behavior

  1. Value 0 accepted without validation
  2. Results in poll_interval(0ms) causing tight loop
  3. CPU spikes to 100% immediately

Additional Context

Tested and Confirmed:

$ vgrep config set watch-debounce 0
✅ Set watch_debounce_ms = 0

DoS Impact: Medium - Can cause local denial of service through CPU exhaustion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingideIssues related to IDEinvalidThis doesn't seem rightvgrep

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions