Skip to content

Conversation

@y001j
Copy link
Owner

@y001j y001j commented Nov 12, 2025

… error handling

This commit addresses three critical issues identified in the code review:

  1. Fix concurrent safety issue with global variable 'increase'

    • Changed from plain uint64 to atomic.Uint64
    • Use atomic.Add(1) for thread-safe ID generation
    • Removed unnecessary panic recovery code
  2. Fix package naming inconsistency in example/echoserver.go

    • Changed all 'UringNet' references to 'uringnet' (lowercase)
    • Ensures consistent package naming throughout the codebase
  3. Add comprehensive error handling

    • Added new error types: ErrSocketCreation, ErrInvalidSocketFd, ErrRingSetup, ErrFileRegister
    • Updated New() function with proper error checking
    • Updated NewMany() function with proper error handling and validation
    • Updated SetLoops() to return error and validate inputs
    • Added error handling to echoserver example with usage instructions
    • Improved error messages with context using fmt.Errorf with %w

These changes improve code reliability, maintainability, and user experience.

… error handling

This commit addresses three critical issues identified in the code review:

1. Fix concurrent safety issue with global variable 'increase'
   - Changed from plain uint64 to atomic.Uint64
   - Use atomic.Add(1) for thread-safe ID generation
   - Removed unnecessary panic recovery code

2. Fix package naming inconsistency in example/echoserver.go
   - Changed all 'UringNet' references to 'uringnet' (lowercase)
   - Ensures consistent package naming throughout the codebase

3. Add comprehensive error handling
   - Added new error types: ErrSocketCreation, ErrInvalidSocketFd, ErrRingSetup, ErrFileRegister
   - Updated New() function with proper error checking
   - Updated NewMany() function with proper error handling and validation
   - Updated SetLoops() to return error and validate inputs
   - Added error handling to echoserver example with usage instructions
   - Improved error messages with context using fmt.Errorf with %w

These changes improve code reliability, maintainability, and user experience.
@y001j y001j merged commit db55fe8 into master Nov 12, 2025
3 checks passed
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