Skip to content

fix: replace unwrap() on map lookups in migration manager - #64

Merged
kacy merged 1 commit into
mainfrom
fix/migration-unwrap
Feb 8, 2026
Merged

fix: replace unwrap() on map lookups in migration manager#64
kacy merged 1 commit into
mainfrom
fix/migration-unwrap

Conversation

@kacy

@kacy kacy commented Feb 8, 2026

Copy link
Copy Markdown
Owner

summary

replaces two .unwrap() calls in MigrationManager::start_import() and start_migrate() with proper error handling using .ok_or(MigrationError::NoMigrationInProgress { slot }).

while logically safe (the key was just inserted on the line before), a distributed system should handle state inconsistencies gracefully rather than crashing. the appropriate error variant already existed.

what was tested

  • cargo build -p ember-cluster — compiles cleanly
  • cargo test -p ember-cluster — all 56 tests pass
  • cargo clippy -p ember-cluster — no warnings

replace .unwrap() with .ok_or(MigrationError::NoMigrationInProgress)
in start_import() and start_migrate(). while logically safe (the key
was just inserted), a distributed system should handle state
inconsistencies gracefully rather than crashing.
@kacy
kacy merged commit ae5e37a into main Feb 8, 2026
5 checks passed
@kacy
kacy deleted the fix/migration-unwrap branch February 8, 2026 20:49
kacy added a commit that referenced this pull request Feb 11, 2026
replace .unwrap() with .ok_or(MigrationError::NoMigrationInProgress)
in start_import() and start_migrate(). while logically safe (the key
was just inserted), a distributed system should handle state
inconsistencies gracefully rather than crashing.
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.

1 participant