@@ -467,30 +467,32 @@ let pollForBugFound workingDirectory (token: Threading.CancellationToken) (runSt
467467 let restlerExperimentLogs = experiment.FullName ++ " logs"
468468
469469 if IO.Directory.Exists restlerExperimentLogs then
470- match ! getListOfBugs workingDirectory runStartTime with
471- | None -> ()
472- | Some bugFiles ->
473- let bugsFoundPosted = restlerExperimentLogs ++ " raft-bugsfound.posted.txt"
474- let! postedBugs =
475- async {
476- if IO.File.Exists bugsFoundPosted then
477- let! bugsPosted = IO.File.ReadAllLinesAsync( bugsFoundPosted) |> Async.AwaitTask
478- return Set.ofArray bugsPosted
479- else
480- return ignoreBugHashes
481- }
482- let! updatedBugsPosted =
483- bugFiles
484- |> Seq.map ( fun ( KeyValue ( bugHash , bugFile )) ->
470+ try
471+ match ! getListOfBugs workingDirectory runStartTime with
472+ | None -> ()
473+ | Some bugFiles ->
474+ let bugsFoundPosted = restlerExperimentLogs ++ " raft-bugsfound.posted.txt"
475+ let! postedBugs =
485476 async {
486- if not <| postedBugs.Contains bugHash then
487- printfn " Posting bug found %s with hash %s " bugFile.file_ path bugHash
488- do ! onBugFound ( Map.empty.Add( " Experiment" , experiment.Name) .Add( " BugBucket" , bugFile.file_ path) .Add( " BugHash" , bugHash))
489- return bugHash
477+ if IO.File.Exists bugsFoundPosted then
478+ let! bugsPosted = IO.File.ReadAllLinesAsync( bugsFoundPosted) |> Async.AwaitTask
479+ return Set.ofArray bugsPosted
480+ else
481+ return ignoreBugHashes
490482 }
491- ) |> Async.Sequential
492- do ! IO.File.WriteAllLinesAsync( bugsFoundPosted, updatedBugsPosted) |> Async.AwaitTask
493-
483+ let! updatedBugsPosted =
484+ bugFiles
485+ |> Seq.map ( fun ( KeyValue ( bugHash , bugFile )) ->
486+ async {
487+ if not <| postedBugs.Contains bugHash then
488+ printfn " Posting bug found %s with hash %s " bugFile.file_ path bugHash
489+ do ! onBugFound ( Map.empty.Add( " Experiment" , experiment.Name) .Add( " BugBucket" , bugFile.file_ path) .Add( " BugHash" , bugHash))
490+ return bugHash
491+ }
492+ ) |> Async.Sequential
493+ do ! IO.File.WriteAllLinesAsync( bugsFoundPosted, updatedBugsPosted) |> Async.AwaitTask
494+ with
495+ | :? System.ArgumentNullException as ex -> printfn " Got excpetion while polling for bug found: %A " ex
494496 return ! poll()
495497 }
496498 poll()
0 commit comments