Skip to content

Commit

Permalink
Don't allow fr_trunk_connection_requests_requeue to run on draining o…
Browse files Browse the repository at this point in the history
…r draining_to_free
  • Loading branch information
arr2036 committed Feb 21, 2020
1 parent e82c8c0 commit e5795d6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/lib/server/trunk.c
Expand Up @@ -1473,6 +1473,11 @@ static uint64_t trunk_connection_requests_requeue(fr_trunk_connection_t *tconn,
}

/** Move requests off of a connection and requeue elsewhere
*
* @note We don't re-queue on draining or draining to free, as requests should have already been
* moved off of te connection. It's also dangerous as the trunk management code main
* clean up a connection in this state when it's run on re-queue, and then the caller
* may try and access a now freed connection.
*
* @param[in] tconn to move requests off of.
* @param[in] states Only move requests in this state.
Expand All @@ -1484,8 +1489,6 @@ uint64_t fr_trunk_connection_requests_requeue(fr_trunk_connection_t *tconn, int
switch (tconn->state) {
case FR_TRUNK_CONN_ACTIVE:
case FR_TRUNK_CONN_INACTIVE:
case FR_TRUNK_CONN_DRAINING:
case FR_TRUNK_CONN_DRAINING_TO_FREE:
return trunk_connection_requests_requeue(tconn, states, max, fail_bound);

default:
Expand Down

0 comments on commit e5795d6

Please sign in to comment.