@@ -30,7 +30,7 @@ type Task struct {
3030 etl.Parser // Parser to parse the tests.
3131
3232 meta map [string ]bigquery.Value // Metadata about this task.
33- maxFileSize int64 // Max file size to avoid OOM.
33+ maxFileSize int64 // Max file size to avoid OOM.
3434}
3535
3636// NewTask constructs a task, injecting the source and the parser.
@@ -61,19 +61,20 @@ func (tt *Task) ProcessAllTests() (int, error) {
6161 var err error
6262 // Read each file from the tar
6363
64+ OUTER:
6465 for testname , data , err = tt .NextTest (tt .maxFileSize ); err != io .EOF ; testname , data , err = tt .NextTest (tt .maxFileSize ) {
6566 files ++
6667 if err != nil {
6768 switch {
6869 case err == io .EOF :
69- break
70+ break OUTER
7071 case err == storage .OVERSIZE_FILE :
7172 log .Printf ("filename:%s testname:%s files:%d, duration:%v err:%v" ,
7273 tt .meta ["filename" ], testname , files ,
7374 time .Since (tt .meta ["parse_time" ].(time.Time )), err )
7475 metrics .TestCount .WithLabelValues (
7576 tt .Parser .TableName (), "unknown" , "oversize file" ).Inc ()
76- continue
77+ continue OUTER
7778 default :
7879 // We are seeing several of these per hour, a little more than
7980 // one in one thousand files. duration varies from 10 seconds
@@ -93,7 +94,7 @@ func (tt *Task) ProcessAllTests() (int, error) {
9394 tt .Parser .TableName (), "unknown" , "unrecovered" ).Inc ()
9495 // Since we don't understand these errors, safest thing to do is
9596 // stop processing the tar file (and task).
96- break
97+ break OUTER
9798 }
9899 }
99100 if data == nil {
0 commit comments