Skip to content

Commit 3cd90e7

Browse files
committed
restore catching simgrid's CancelException
1 parent 3879071 commit 3cd90e7

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

‎src/FileEngine.cpp‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,17 @@ void FileEngine::end_sub_transaction()
245245
file_sub_transaction_[self].push(file->read_async(size));
246246

247247
XBT_DEBUG("Wait for the %d subscribe activities for the transaction", file_sub_transaction_[self].size());
248-
file_sub_transaction_[self].wait_all();
248+
try {
249+
file_sub_transaction_[self].wait_all();
250+
} catch (const simgrid::CancelException&) {
251+
if (!is_canceled())
252+
throw;
253+
file_sub_transaction_[self].clear();
254+
transport->close_sub_files(self);
255+
transport->clear_to_read_in_transaction(self);
256+
sub_transaction_in_progress_ = false;
257+
throw TransactionCanceledException(XBT_THROW_POINT);
258+
}
249259
if (is_transaction_canceled(current_sub_transaction_id_)) {
250260
file_sub_transaction_[self].clear();
251261
transport->close_sub_files(self);

‎src/StagingEngine.cpp‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ 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_canceled())
82+
throw;
83+
get_pub_transaction().clear();
84+
throw TransactionCanceledException(XBT_THROW_POINT);
8085
} catch (const simgrid::NetworkFailureException&) {
8186
if (!is_canceled())
8287
throw;

0 commit comments

Comments
 (0)