Objective
Add graceful handling of fsnotify.ErrEventOverflow errors to provide user-friendly feedback when the kernel buffer overflows and events are lost.
Context
In pkg/cli/compile_command.go:912, the error handling currently treats all watcher errors equally. However, ErrEventOverflow is a specific condition that indicates the kernel's event buffer was full and some file system events were lost. This requires different handling to inform users clearly.
Approach
Enhance the error handler to detect overflow errors and provide actionable feedback:
case err, ok := <-watcher.Errors:
if !ok {
return fmt.Errorf("watcher error channel closed")
}
if errors.Is(err, fsnotify.ErrEventOverflow) {
fmt.Fprintf(os.Stderr, console.FormatWarningMessage(
"File system event buffer overflow - some changes may have been missed. " +
"Consider using --verbose mode or reducing concurrent file modifications."))
} else {
compileLog.Printf("Watcher error: %v", err)
if verbose {
fmt.Printf("⚠️ Watcher error: %v\\n", err)
}
}
Files to Modify
- Update:
pkg/cli/compile_command.go (lines ~912+, error handling in watch loop)
Testing
- Simulate overflow conditions by rapidly modifying many workflow files simultaneously
- Verify overflow warning appears with clear, actionable message
- Ensure watch mode continues to function after overflow
- Test that other error types still produce appropriate log messages
- Verify message formatting is consistent with other console output
Acceptance Criteria
AI generated by Plan Command for discussion #5175
Objective
Add graceful handling of
fsnotify.ErrEventOverflowerrors to provide user-friendly feedback when the kernel buffer overflows and events are lost.Context
In
pkg/cli/compile_command.go:912, the error handling currently treats all watcher errors equally. However,ErrEventOverflowis a specific condition that indicates the kernel's event buffer was full and some file system events were lost. This requires different handling to inform users clearly.Approach
Enhance the error handler to detect overflow errors and provide actionable feedback:
Files to Modify
pkg/cli/compile_command.go(lines ~912+, error handling in watch loop)Testing
Acceptance Criteria
ErrEventOverflowis detected usingerrors.Is()console.FormatWarningMessage()for consistent formatting