Commit 96356b39 authored by Alessio Netti's avatar Alessio Netti

Analytics: independent try-catch blocks for each unit computation

- If a single unit of an operator fails computation, this does not
prevent anymore all other units from computing
parent 615b0a85
......@@ -275,9 +275,16 @@ protected:
}
// Performing actual computation on each unit
for(size_t idx=0; idx<_tempUnits.size(); idx++)
if(_tempUnits[idx])
this->compute(_tempUnits[idx], _jobDataVec[idx]);
for(size_t idx=0; idx<_tempUnits.size(); idx++) {
if (_tempUnits[idx]) {
try {
this->compute(_tempUnits[idx], _jobDataVec[idx]);
} catch(const exception& e) {
LOG(error) << e.what();
continue;
}
}
}
// Acquiring the spinlock to refresh the exposed units
while(_unitAccess.exchange(true)) {}
this->clearUnits();
......
......@@ -474,14 +474,21 @@ protected:
*
*/
virtual void computeAsync() override {
try {
if (_duplicate && _unitID >= 0)
if (_duplicate && _unitID >= 0) {
try {
compute(_units[_unitID]);
else
for (unsigned i = 0; i < _units.size(); i++)
} catch(const exception& e) {
LOG(error) << e.what();
}
} else {
for (unsigned i = 0; i < _units.size(); i++) {
try {
compute(_units[i]);
} catch(const exception& e) {
LOG(error) << e.what();
} catch (const exception &e) {
LOG(error) << e.what();
continue;
}
}
}
if (_timer && _keepRunning && !_disabled) {
......
Markdown is supported
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