aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-01-16 21:59:55 +0100
committerDmitry Vyukov <dvyukov@google.com>2017-01-17 17:14:11 +0100
commit3b74730dc9c8f2913a947ee5ab4c9e69251a67c0 (patch)
tree555666afc8e8dc392742e39c23bf85d5cd303869
parente364ddead32bae26403470a6175511d3b3fb8ac1 (diff)
syz-gce: recover after git pull errors
One of builders got into error loop: Jan 16 20:55:45 syz-gce-next syz-gce[15380]: 2017/01/16 20:55:45 failed to run git [pull]: exit status 128 Jan 16 20:55:45 syz-gce-next syz-gce[15380]: error: Pull is not possible because you have unmerged files. Jan 16 20:55:45 syz-gce-next syz-gce[15380]: hint: Fix them up in the work tree, and then use 'git add/rm <file>' Jan 16 20:55:45 syz-gce-next syz-gce[15380]: hint: as appropriate to mark resolution and make a commit. Jan 16 20:55:45 syz-gce-next syz-gce[15380]: fatal: Exiting because of an unresolved conflict. No local changes were made to the repo. It was somehow caused by too many changed files or something. Make pull more robust: in case of any errors re-clone the repo.
-rw-r--r--syz-gce/syz-gce.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/syz-gce/syz-gce.go b/syz-gce/syz-gce.go
index d3e680a2a..e915d99c0 100644
--- a/syz-gce/syz-gce.go
+++ b/syz-gce/syz-gce.go
@@ -167,6 +167,7 @@ func main() {
linuxHash, err = gitUpdate(linuxDir, cfg.Linux_Git, cfg.Linux_Branch)
if err != nil {
Logf(0, "%v", err)
+ delayDuration = time.Hour // cloning linux is expensive
continue
}
Logf(0, "kernel hash %v, syzkaller hash %v", linuxHash, syzkallerHash)
@@ -485,7 +486,7 @@ func updateSyzkallerBuild() (string, error) {
}
func gitUpdate(dir, repo, branch string) (string, error) {
- if _, err := gitRevision(dir); err != nil {
+ if _, err := runCmd(dir, "git", "pull"); err != nil {
if err := os.RemoveAll(dir); err != nil {
return "", fmt.Errorf("failed to remove repo dir: %v", err)
}
@@ -495,9 +496,9 @@ func gitUpdate(dir, repo, branch string) (string, error) {
if _, err := runCmd("", "git", "clone", repo, dir); err != nil {
return "", err
}
- }
- if _, err := runCmd(dir, "git", "pull"); err != nil {
- return "", err
+ if _, err := runCmd(dir, "git", "pull"); err != nil {
+ return "", err
+ }
}
if branch != "" {
if _, err := runCmd(dir, "git", "checkout", branch); err != nil {