Skip to content

Commit

Permalink
cst/cache: fix use-after-move caused by calling get_exception twice
Browse files Browse the repository at this point in the history
Found by @dotnwat redpanda-data#24000 (comment)

(cherry picked from commit ec90163)
  • Loading branch information
nvartolomei authored and vbotbuildovich committed Nov 20, 2024
1 parent 151c85d commit 0a36379
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/v/cloud_storage/cache_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1311,14 +1311,15 @@ ss::future<> cache::put(
if (!_gate.is_closed()) {
auto delete_tmp_fut = co_await ss::coroutine::as_future(
delete_file_and_empty_parents(tmp_filepath.native()));
if (
delete_tmp_fut.failed()
&& !ssx::is_shutdown_exception(delete_tmp_fut.get_exception())) {
vlog(
cst_log.error,
"Failed to delete tmp file {}: {}",
tmp_filepath.native(),
delete_tmp_fut.get_exception());
if (delete_tmp_fut.failed()) {
auto e = delete_tmp_fut.get_exception();
if (!ssx::is_shutdown_exception(e)) {
vlog(
cst_log.error,
"Failed to delete tmp file {}: {}",
tmp_filepath.native(),
e);
}
}
}

Expand Down

0 comments on commit 0a36379

Please sign in to comment.