-
Notifications
You must be signed in to change notification settings - Fork 296
Closed as not planned
Labels
Description
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
-
ErrEventOverflowis detected usingerrors.Is() - User-friendly warning message explains the issue
- Message suggests potential solutions (verbose mode, reduce concurrent changes)
- Uses
console.FormatWarningMessage()for consistent formatting - Other error types continue to be logged appropriately
- Watch mode remains functional after overflow condition
AI generated by Plan Command for discussion #5175
Reactions are currently unavailable