Skip to content

Commit

Permalink
AER-6470 - don't uncork under send-q lock.
Browse files Browse the repository at this point in the history
  • Loading branch information
gooding470 authored Sep 3, 2021
1 parent 586504a commit af61c20
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions as/src/fabric/fabric.c
Original file line number Diff line number Diff line change
Expand Up @@ -1765,31 +1765,31 @@ fabric_connection_process_writable(fabric_connection *fc)

cf_mutex_lock(&node->send_queue_lock[pool]);

if (fc->failed) {
if (! fc->node->live || fc->failed) {
cf_mutex_unlock(&node->send_queue_lock[pool]);
return false;
}

if (cf_queue_pop(&node->send_queue[pool], &fc->s_msg_in_progress,
CF_QUEUE_NOWAIT) != CF_QUEUE_OK) {
fabric_connection_uncork(fc);
fc_pool_push(&node->send_idle_fc_pool[pool], fc);
cf_mutex_unlock(&node->send_queue_lock[pool]);
return true;
}

cf_mutex_unlock(&node->send_queue_lock[pool]);
}
fabric_connection_uncork(fc);

fabric_connection_uncork(fc);
cf_mutex_lock(&node->send_queue_lock[pool]);

if (! fc->node->live || fc->failed) {
return false;
}
if (cf_queue_pop(&node->send_queue[pool], &fc->s_msg_in_progress,
CF_QUEUE_NOWAIT) != CF_QUEUE_OK) {
fc_pool_push(&node->send_idle_fc_pool[pool], fc);
cf_mutex_unlock(&node->send_queue_lock[pool]);
return true;
}
}

fabric_connection_send_rearm(fc);
cf_mutex_unlock(&node->send_queue_lock[pool]);
}

return true;
return false; // unreachable
}

// Return true on success.
Expand Down

0 comments on commit af61c20

Please sign in to comment.