From 3b4d4baa1b4c3332ad346ae670905e913fcb692f Mon Sep 17 00:00:00 2001 From: Henry Winkel Date: Tue, 19 Dec 2023 19:47:20 +0100 Subject: [PATCH] FIX: fixed issue of deleting entity --- libs/KubeControl | 2 +- src/Entities/Entity.cpp | 27 ++++++++++++++++++--------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/libs/KubeControl b/libs/KubeControl index 53d2b9f..894b2a0 160000 --- a/libs/KubeControl +++ b/libs/KubeControl @@ -1 +1 @@ -Subproject commit 53d2b9f8906dcae5f4e66b130e6f2dc26bce5321 +Subproject commit 894b2a08d671fc5d4144779af8f78d9fbb502a32 diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp index 8c4e7a8..5f6b036 100644 --- a/src/Entities/Entity.cpp +++ b/src/Entities/Entity.cpp @@ -138,32 +138,41 @@ namespace Entities void Entity::stop() { - stopChild(); - + try { + PodController_->stopAllPods(); - - MovemtServer_.reset(); + LOG_S(INFO)<<"Pods stoppt"; + stopChild(); + LOG_S(INFO)<<"childs stoppt"; + + // MovemtServer_.reset(); + LOG_S(INFO)<<"MovemtServer_ reseted"; stopMainLoop = true; - BroadcastServer_.reset(); - + // BroadcastServer_.reset(); + LOG_S(INFO)<<"BroadcastServer_ reseted"; + for (std::vector::iterator it = threads.begin(); it != threads.end();) { if (it->joinable()) { + it->join(); it = threads.erase(it); } } - LOG_S(ERROR)<< threads.size(); - std::this_thread::sleep_for(std::chrono::milliseconds(30000)); + LOG_S(ERROR)<< "Remaining Threads: " << threads.size(); + // std::this_thread::sleep_for(std::chrono::milliseconds(30000)); - exit(0); + // exit(0); + } catch (const std::exception e) { + LOG_S(ERROR)<< e.what(); + } } void Entity::startMovementWorker()