Prechádzať zdrojové kódy

Alert if the logs being parsed are malformed

Ian Goldberg 1 rok pred
rodič
commit
eb38329ad0
1 zmenil súbory, kde vykonal 5 pridanie a 0 odobranie
  1. 5 0
      Docker/parse_logs

+ 5 - 0
Docker/parse_logs

@@ -95,6 +95,7 @@ sub parse_2P_read {
     my @online_kib = ();
     while(<>) {
         last if /===== End/;
+        die "Malformed log" if /===== Running/;
         if (/===== P([012]) output/) {
             $who = $1;
             next;
@@ -126,6 +127,7 @@ sub parse_2P_write_preproc {
     my @preproc_kib = ();
     while(<>) {
         last if /===== End/;
+        die "Malformed log" if /===== Running/;
         if (/===== P([012]) output/) {
             $who = $1;
             next;
@@ -155,6 +157,7 @@ sub parse_2P_write_online {
     my @online_kib = ();
     while(<>) {
         last if /===== End/;
+        die "Malformed log" if /===== Running/;
         if (/===== P([012]) output/) {
             $who = $1;
             next;
@@ -182,6 +185,7 @@ sub parse_3P_preproc {
             next;
         }
         last if /===== End/;
+        die "Malformed log" if /===== Running/;
         if (/WallClockTime: (\d+\.?\d*)/) {
             $preproc_s[$who] = $1;
         }
@@ -209,6 +213,7 @@ sub parse_3P_online {
     my @readwrite_kib = ();
     while(<>) {
         last if /===== End/;
+        die "Malformed log" if /===== Running/;
         if (/===== P([012]) output/) {
             $who = $1;
             next;