Skip to content

Commit

Permalink
Fixes #15425: relayd should only control run date consistency inside …
Browse files Browse the repository at this point in the history
…the runlog
  • Loading branch information
amousset committed Aug 7, 2019
1 parent 0d1a641 commit fc776d1
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions relay/sources/relayd/src/data/runlog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ impl TryFrom<(RunInfo, Vec<RawReport>)> for RunLog {
.flat_map(RawReport::into_reports)
.collect();
let info = raw_reports.0;
let timestamp = reports
.first()
.ok_or(Error::InconsistentRunlog)?
.start_datetime;

for report in &reports {
if info.node_id != report.node_id {
Expand All @@ -132,12 +136,11 @@ impl TryFrom<(RunInfo, Vec<RawReport>)> for RunLog {
);
return Err(Error::InconsistentRunlog);
}
if info.timestamp != report.start_datetime {
error!(
if timestamp != report.start_datetime {
warn!(
"Wrong execution timestamp in report {:#?}, got {} but should be {}",
report, report.start_datetime, info.timestamp
report, report.start_datetime, timestamp
);
return Err(Error::InconsistentRunlog);
}
}
Ok(Self { info, reports })
Expand Down

0 comments on commit fc776d1

Please sign in to comment.