Skip to content

Commit 9b579c0

Browse files
committed
throw CancelledException earlier
1 parent 7e28102 commit 9b579c0

2 files changed

Lines changed: 4 additions & 12 deletions

File tree

src/FileEngine.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -242,11 +242,8 @@ void FileEngine::end_sub_transaction()
242242
file_sub_transaction_[self].push(file->read_async(size));
243243

244244
XBT_DEBUG("Wait for the %d subscribe activities for the transaction", file_sub_transaction_[self].size());
245-
try {
246-
file_sub_transaction_[self].wait_all();
247-
} catch (const simgrid::CancelException&) {
248-
if (!is_cancelled())
249-
throw;
245+
file_sub_transaction_[self].wait_all();
246+
if (is_cancelled()) {
250247
file_sub_transaction_[self].clear();
251248
transport->close_sub_files(self);
252249
transport->clear_to_read_in_transaction(self);

src/StagingEngine.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,20 +77,15 @@ void StagingEngine::begin_pub_transaction()
7777
current_pub_transaction_id_, current_sub_transaction_id_, get_pub_transaction().size());
7878
try {
7979
get_pub_transaction().wait_all();
80-
} catch (const simgrid::CancelException&) {
81-
if (!is_cancelled())
82-
throw;
83-
get_pub_transaction().clear();
84-
throw TransactionCancelledException(XBT_THROW_POINT);
8580
} catch (const simgrid::NetworkFailureException&) {
8681
if (!is_cancelled())
8782
throw;
88-
get_pub_transaction().clear();
89-
throw TransactionCancelledException(XBT_THROW_POINT);
9083
}
9184
XBT_DEBUG("All on-flight publish activities are completed. Proceed with the current transaction.");
9285
XBT_DEBUG("%u sub activities pending", get_sub_transaction().size());
9386
get_pub_transaction().clear();
87+
if (is_cancelled())
88+
throw TransactionCancelledException(XBT_THROW_POINT);
9489
}
9590

9691
// Then we wait for all subscribers to be at the same transaction

0 commit comments

Comments
 (0)