-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
disk import: Prioritize returning upload errors #992
Conversation
When sending chunks of the file to upload tasks, we return an error if the channel to that task is closed. This situation will happen if the upload task has panicked or already returned due to an error. However, we check for an error from the sending task first, and the `failed to send chunks` error will be surfaced to the user, rather than the true problem that occurred in the upload task. In the inverse situation, where the reader fails, the uploaders will return gracefully when their channels are closed, so we do not need to worry about a problem reading the file showing up as an upload error. Update our error handling to check for an error from the upload tasks, then the reader if those returned cleanly.
Issue reported by a customer in https://oxidecomputer.slack.com/archives/C089VG8LHPG/p1738198958814399 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if there's a legitimate problem reading a file and there's a problem sending a chunk. I'd suggest we might want to look at both the results
and read_result
and say: "we had this 1 problem" or "there were several problems and these were they"
The index of the failed task doesn't provide more context to users and might be accidentally construed as a backtrace. Just list the bare errors for each failed request. Also, use a standard `DiskImportError::context` if a single task failed.
If the file reader task fails to send a chunk to an upload task, we know this is because that task has either returned due to an error or panicked. In either case this isn't an error for the reader, which should return early as the overall request will fail.
The errors returned by a connection failure are long enough to wrap in a user's terminal. Add a `*` to the start to make distinguishing errors easier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good progress. I think the break Ok(()) is right from the send failure; nice comment.
When sending chunks of the file to upload tasks, we return an error if the channel to that task is closed. This situation will happen if the upload task has panicked or already returned due to an error. However, we check for an error from the sending task first, and the
failed to send chunks
error will be surfaced to the user, rather than the true problem that occurred in the upload task.In the inverse situation, where the reader fails, the uploaders will return gracefully when their channels are closed, so we do not need to worry about a problem reading the file showing up as an upload error.
Update our error handling to check for an error from the upload tasks, then the reader if those returned cleanly.