Commit b67adedc authored by Micha Mueller's avatar Micha Mueller
Browse files

Fix dcdbpusher not terminating if no thraeds executing sensor groups are available

parent 2436f553
...@@ -68,11 +68,22 @@ public: ...@@ -68,11 +68,22 @@ public:
/** /**
* Does a busy wait until all dispatched handlers are finished (_pendingTasks == 0) * Does a busy wait until all dispatched handlers are finished (_pendingTasks == 0)
* If the wait takes longer than a reasonable amount of time we return anyway,
* to not block termination of dcdbpusher.
*/ */
void wait() { void wait() {
while(_pendingTasks) { unsigned short retries = 3;
sleep(1);
} for (unsigned short i = 1; i <= retries; i++) {
if (_pendingTasks) {
LOG(info) << "Group " << _groupName << " not yet finished. Waiting... (" << i << "/" << retries << ")";
sleep((_interval/1000) + 1);
} else {
return;
}
}
LOG(warning) << "Group " << _groupName << " will not finish! Skipping it";
} }
//can be overwritten //can be overwritten
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment