Skip to content

Commit

Permalink
Better log messages during queueing
Browse files Browse the repository at this point in the history
  • Loading branch information
janbuchar committed Apr 5, 2018
1 parent ebc9044 commit 5068291
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions src/handlers/broker_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,6 @@ void broker_handler::process_worker_done(

if (next_request != nullptr) {
send_request(worker, next_request, respond);
} else {
logger_->debug(" - worker {} is now free", worker->get_description());
}

runtime_stats_[STATS_EVALUATED_JOBS] += 1;
Expand Down Expand Up @@ -329,6 +327,10 @@ void broker_handler::process_worker_done(
} else {
logger_->warn("Received unexpected status code {} from worker {}", status, worker->get_description());
}

if (queue_->get_current_request(worker) == nullptr) {
logger_->debug(" - worker {} is now free", worker->get_description());
}
}

void broker_handler::process_worker_ping(
Expand Down Expand Up @@ -447,13 +449,14 @@ bool broker_handler::reassign_request(worker::request_ptr request, handler_inter

if (!result.enqueued) {
notify_monitor(request, "FAILED", respond);
logger_->debug(" - failed to enqueue job {}", request->data.get_job_id());
return false;
}

if (result.assigned_to != nullptr) {
send_request(result.assigned_to, request, respond);
logger_->debug(
" - job {} queued for worker {}", request->data.get_job_id(), result.assigned_to->get_description());
} else {
logger_->debug(" - job {} is now waiting in the queue", request->data.get_job_id());
}

return true;
Expand Down
2 changes: 1 addition & 1 deletion src/queuing/queue_manager_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ struct enqueue_result {
worker_ptr assigned_to;

/**
* True if the request was successfully enqueued, false otherwise
* True if the request was successfully enqueued or assigned to a worker, false otherwise
*/
bool enqueued;
};
Expand Down

0 comments on commit 5068291

Please sign in to comment.