Skip to content

Commit

Permalink
Merge pull request #10060 from Icinga/IcingaDB-SerializeState-executi…
Browse files Browse the repository at this point in the history
…on_time-latency

IcingaDB#SerializeState(): limit execution_time and latency to 2^32-1
  • Loading branch information
Al2Klimov authored Jun 13, 2024
2 parents c5c7925 + f9adf18 commit f1be9b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/icingadb/icingadb-objects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2642,8 +2642,8 @@ Dictionary::Ptr IcingaDB::SerializeState(const Checkable::Ptr& checkable)

if (!cr->GetCommand().IsEmpty())
attrs->Set("check_commandline", FormatCommandLine(cr->GetCommand()));
attrs->Set("execution_time", TimestampToMilliseconds(fmax(0.0, cr->CalculateExecutionTime())));
attrs->Set("latency", TimestampToMilliseconds(cr->CalculateLatency()));
attrs->Set("execution_time", std::min((long long)UINT32_MAX, TimestampToMilliseconds(fmax(0.0, cr->CalculateExecutionTime()))));
attrs->Set("latency", std::min((long long)UINT32_MAX, TimestampToMilliseconds(cr->CalculateLatency())));
attrs->Set("check_source", cr->GetCheckSource());
attrs->Set("scheduling_source", cr->GetSchedulingSource());
}
Expand Down

0 comments on commit f1be9b7

Please sign in to comment.