Skip to content

[mmap sparse vector storage] return cancelled error if stopped - #5938

Merged
coszio merged 2 commits into
devfrom
skip-err-if-cancelled
Feb 3, 2025
Merged

coszio merged 2 commits into
devfrom
skip-err-if-cancelled

Conversation

@coszio

@coszio coszio commented Feb 3, 2025

Copy link
Copy Markdown
Contributor

This fixes a bug that happened when updating a mmap sparse vector storage is cancelled.

An invariant was broken when handling the stopped flag. All other implementations stop midway and return OperationError::Cancelled, but this implementation just stopped iterating, and returned a partial updated range.

This caused the range check to fail, don't handle cancellation nicely, and send a service error back all the way to the user.

@coszio
coszio requested review from generall and timvisee February 3, 2025 18:40
Comment on lines +243 to +246

// return cancelled error if stopped
check_process_stopped(stopped)?;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is the fix

@coszio
coszio merged commit 0c81adc into dev Feb 3, 2025
@coszio
coszio deleted the skip-err-if-cancelled branch February 3, 2025 22:25
timvisee pushed a commit that referenced this pull request Feb 11, 2025
* return cancelled error if stopped

* add doc comment and renames
@timvisee timvisee mentioned this pull request Feb 11, 2025
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.

2 participants