Skip to content

Commit

Permalink
remember to unlock the mutex
Browse files Browse the repository at this point in the history
  • Loading branch information
alandekok committed Jan 4, 2025
1 parent 5fd2a98 commit 9066381
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/threads.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,6 @@ int request_enqueue(REQUEST *request)
if ((thread_pool.num_queued >= thread_pool.max_queue_size) &&
(request_discard_lower_priority(request->priority) == 0)) {
pthread_mutex_unlock(&thread_pool.queue_mutex);

RATE_LIMIT(ERROR("Something is blocking the server. There are %d packets in the queue, "
"waiting to be processed. Ignoring the new request.", thread_pool.num_queued));
return 0;
Expand All @@ -526,6 +525,7 @@ int request_enqueue(REQUEST *request)
* Push the request onto the appropriate fifo for that priority.
*/
if (!fr_fifo_push(thread_pool.fifo[request->priority], request)) {
pthread_mutex_unlock(&thread_pool.queue_mutex);
RATE_LIMIT(ERROR("Something is blocking the server. There are too many packets in the queue, "
"waiting to be processed. Ignoring the new request."));
return 0;
Expand Down

0 comments on commit 9066381

Please sign in to comment.