Skip to content

Conversation

@XuQianJin-Stars
Copy link
Contributor

Replace unwrap() calls with proper error handling in environment variable parsing functions to prevent panics when invalid values are provided.

Changes:

  • get_default_batch_size(): Handle invalid LANCE_DEFAULT_BATCH_SIZE values
  • DEFAULT_FRAGMENT_READAHEAD: Handle invalid LANCE_DEFAULT_FRAGMENT_READAHEAD values
  • DEFAULT_XTR_OVERFETCH: Handle invalid LANCE_XTR_OVERFETCH values
  • DEFAULT_IO_BUFFER_SIZE: Handle invalid LANCE_DEFAULT_IO_BUFFER_SIZE values

When parsing fails, the functions now:

  1. Log a warning message with the invalid value and error
  2. Fall back to default values gracefully
  3. Prevent application crashes due to configuration errors

Added test_env_var_parsing() to verify the new error handling behavior.

@github-actions github-actions bot added the bug Something isn't working label Dec 22, 2025
@XuQianJin-Stars XuQianJin-Stars force-pushed the fix/env-var-parsing-error-handling branch from aeb086d to 9f91118 Compare December 24, 2025 02:12
@codecov
Copy link

codecov bot commented Dec 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@XuQianJin-Stars XuQianJin-Stars force-pushed the fix/env-var-parsing-error-handling branch from 9f91118 to 24657a1 Compare December 25, 2025 09:54
@XuQianJin-Stars XuQianJin-Stars force-pushed the fix/env-var-parsing-error-handling branch from 24657a1 to 66eab2e Compare December 25, 2025 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant