Skip to content
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

remote: fix exception checking in delete_objects_sequentially #17559

Merged

Conversation

andrwng
Copy link
Contributor

@andrwng andrwng commented Apr 2, 2024

Catching the exception with const std::exception& as the type forces the compiler to understand the error's type as std::exception, and trips up our shutdown-error-checking[1].

This change updates the code to pass the std::current_exception() exception_ptr directly to is_shutdown_exception().

This previously showed up as an error log:

cloud_storage - [fiber28~216|0|29845ms] - remote.cc:1293 - Failed to delete keys: Sleep is aborted

Fixes #17506

[1] https://godbolt.org/z/xqeabz35r

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v23.3.x
  • v23.2.x

Release Notes

  • none

Catching the exception with `const std::exception&` as the type forces
the compiler to understand the error's type as `std::exception`, and
trips up our shutdown-error-checking[1].

This change updates the code to pass the `std::current_exception()`
`exception_ptr` directly to `is_shutdown_exception()`.

This previously showed up as an error log:

```
cloud_storage - [fiber28~216|0|29845ms] - remote.cc:1293 - Failed to delete keys: Sleep is aborted
```

Fixes redpanda-data#17506

[1] https://godbolt.org/z/xqeabz35r
@andrwng andrwng force-pushed the remote-delete-shutdown-errors branch from f2a143b to 7c09f37 Compare April 2, 2024 22:36
@vbotbuildovich
Copy link
Collaborator

});
std::vector<upload_result> results;
results.reserve(key_nodes.size());
auto fut = co_await ss::coroutine::as_future(ss::max_concurrent_for_each(
Copy link
Contributor

Choose a reason for hiding this comment

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

didn't know about coroutine::as_future, this is really nice

@piyushredpanda piyushredpanda merged commit 8c32bd5 into redpanda-data:dev Apr 4, 2024
17 checks passed
results.push_back(result);
});
})
.handle_exception_type([ctxlog](const std::exception& ex) {
Copy link
Member

Choose a reason for hiding this comment

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

+1 to switching to coroutine. Just so I understand, this fix could also have been to change .handle_exception_type([ctxlog](const std::exception& ex) to .handle_exception([ctxlog](std::exception_ptr eptr)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ha 🤦, yea I think so

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CI Failure (key symptom) in CloudStorageTimingStressTest.test_cloud_storage_with_partition_moves
5 participants