Skip to content

Commit

Permalink
Release of stable version 1.0.0! 🏆 🎆
Browse files Browse the repository at this point in the history
  • Loading branch information
SemaiCZE committed Nov 19, 2016
1 parent 54f3394 commit 3621211
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 24 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.2)
project(recodex-broker)
set(RECODEX_VERSION "0.2.0")
set(RECODEX_VERSION "1.0.0")

set(EXEC_NAME ${PROJECT_NAME})
enable_testing()
Expand Down
6 changes: 4 additions & 2 deletions src/handlers/broker_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ void broker_handler::process_worker_done(
auto failed_request = worker->cancel_request();

if (!failed_request->data.is_complete()) {
status_notifier.rejected_job(failed_request->data.get_job_id(), "Job failed with '" + message.at(3) + "' and cannot be reassigned");
status_notifier.rejected_job(
failed_request->data.get_job_id(), "Job failed with '" + message.at(3) + "' and cannot be reassigned");
} else if (check_failure_count(failed_request, status_notifier)) {
reassign_request(failed_request, respond);
} else {
Expand Down Expand Up @@ -335,7 +336,8 @@ void broker_handler::process_timer(const message_container &message, handler_int

for (auto request : *requests) {
if (!request->data.is_complete()) {
status_notifier.rejected_job(request->data.get_job_id(), "Worker timed out and its job cannot be reassigned");
status_notifier.rejected_job(
request->data.get_job_id(), "Worker timed out and its job cannot be reassigned");
continue;
}

Expand Down
1 change: 0 additions & 1 deletion src/worker.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class job_request_data
/**
* A constructor for incomplete jobs (only id without request frames)
* @param job_id identification of job
* @param additional additional information which will be added to standard message
*/
job_request_data(const std::string &job_id) : job_id_(job_id), complete_(false)
{
Expand Down
41 changes: 21 additions & 20 deletions tests/broker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -516,15 +516,16 @@ TEST(broker, worker_orphan_job_internal_failure)

// We cannot reassign the job (we don't know its headers). Let's just report it as failed.
ASSERT_THAT(messages,
ElementsAre(message_container(
broker_connect::KEY_STATUS_NOTIFIER, "", {"type",
"job-status",
"id",
request_1->data.get_job_id(),
"status",
"FAILED",
"message",
"Job failed with 'Testing failure' and cannot be reassigned"})));
ElementsAre(message_container(broker_connect::KEY_STATUS_NOTIFIER,
"",
{"type",
"job-status",
"id",
request_1->data.get_job_id(),
"status",
"FAILED",
"message",
"Job failed with 'Testing failure' and cannot be reassigned"})));

messages.clear();
}
Expand Down Expand Up @@ -572,8 +573,7 @@ TEST(broker, worker_expiration_dont_reassign_orphan_job)

// There are two workers in the registry, one of them has an orphan job and will die
auto worker_1 = std::make_shared<worker>("identity_1", "group_1", worker_headers_t{{"env", "c"}});
auto request_1 =
std::make_shared<request>(job_request_data("job_id"));
auto request_1 = std::make_shared<request>(job_request_data("job_id"));
auto worker_2 = std::make_shared<worker>("identity_2", "group_1", worker_headers_t{{"env", "c"}});
worker_1->liveness = 1;
worker_1->enqueue_request(request_1);
Expand All @@ -594,15 +594,16 @@ TEST(broker, worker_expiration_dont_reassign_orphan_job)
handler.on_request(message_container(broker_connect::KEY_TIMER, "", {"1100"}), respond);

ASSERT_THAT(messages,
ElementsAre(message_container(
broker_connect::KEY_STATUS_NOTIFIER, "", {"type",
"job-status",
"id",
request_1->data.get_job_id(),
"status",
"FAILED",
"message",
"Worker timed out and its job cannot be reassigned"})));
ElementsAre(message_container(broker_connect::KEY_STATUS_NOTIFIER,
"",
{"type",
"job-status",
"id",
request_1->data.get_job_id(),
"status",
"FAILED",
"message",
"Worker timed out and its job cannot be reassigned"})));

messages.clear();
}
Expand Down

0 comments on commit 3621211

Please sign in to comment.