From fc1923a20a263a864a9a6e89a45febd977bc9ae0 Mon Sep 17 00:00:00 2001 From: KyleKlenk <kyle.c.klenk@gmail.com> Date: Wed, 13 Jul 2022 14:44:06 -0600 Subject: [PATCH] fixed bug where server would exit early --- build/source/actors/summa_actor/summa_server.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/build/source/actors/summa_actor/summa_server.cpp b/build/source/actors/summa_actor/summa_server.cpp index fec6fd0..51c6d1c 100644 --- a/build/source/actors/summa_actor/summa_server.cpp +++ b/build/source/actors/summa_actor/summa_server.cpp @@ -128,11 +128,17 @@ behavior summa_server(stateful_actor<summa_server_state>* self, std::string conf self->state.config_path); } else { - aout(self) << "We Are Done - Telling Clients to exit \n"; - for (std::vector<int>::size_type i = 0; i < self->state.client_list.size(); i++) { - self->send(self->state.client_list[i].getActor(), time_to_exit_v); + // We found no batch this means all batches are assigned + if (self->state.batches_remaining == 0) { + aout(self) << "All Batches Solved -- Telling Clients To Exit\n"; + for (std::vector<int>::size_type i = 0; i < self->state.client_list.size(); i++) { + self->send(self->state.client_list[i].getActor(), time_to_exit_v); + } + aout(self) << "\nSUMMA_SERVER -- EXITING\n"; + self->quit(); + } else { + aout(self) << "No Batches left to compute -- letting client stay connected in case batch fails\n"; } - self->quit(); } } }; -- GitLab