Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/timeout-destructors' into timeou…
Browse files Browse the repository at this point in the history
…t-destructors
  • Loading branch information
pentschev committed Nov 16, 2023
2 parents 67c0d99 + 68aef08 commit 4d4e9f7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cpp/src/endpoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ void Endpoint::close(uint64_t period, uint64_t maxAttempts)

if (worker->isProgressThreadRunning()) {
bool closeSuccess = false;
for (uint64_t i = 0; i < maxAttempts; ++i) {
for (uint64_t i = 0; i < maxAttempts && !closeSuccess; ++i) {
utils::CallbackNotifier callbackNotifierPre{};
worker->registerGenericPre([this, &callbackNotifierPre, &status, closeMode]() {
status = ucp_ep_close_nb(_handle, closeMode);
Expand Down Expand Up @@ -277,7 +277,7 @@ size_t Endpoint::cancelInflightRequests(uint64_t period, uint64_t maxAttempts)
worker->progress();
} else if (worker->isProgressThreadRunning()) {
bool cancelSuccess = false;
for (uint64_t i = 0; i < maxAttempts; ++i) {
for (uint64_t i = 0; i < maxAttempts && !cancelSuccess; ++i) {
utils::CallbackNotifier callbackNotifierPre{};
worker->registerGenericPre([this, &callbackNotifierPre, &canceled]() {
canceled = _inflightRequests->cancelAll();
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/worker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ size_t Worker::cancelInflightRequests(uint64_t period, uint64_t maxAttempts)
progressPending();
} else if (isProgressThreadRunning()) {
bool cancelSuccess = false;
for (uint64_t i = 0; i < maxAttempts; ++i) {
for (uint64_t i = 0; i < maxAttempts && !cancelSuccess; ++i) {
utils::CallbackNotifier callbackNotifierPre{};
registerGenericPre([&callbackNotifierPre, &canceled, &inflightRequestsToCancel]() {
canceled = inflightRequestsToCancel->cancelAll();
Expand Down

0 comments on commit 4d4e9f7

Please sign in to comment.