From 0d21d19e0353d241914393b482a4411db8e4d309 Mon Sep 17 00:00:00 2001 From: Ryan Tseng Date: Thu, 16 Feb 2017 13:30:27 -0800 Subject: [PATCH] Bot_update: kill git if it's too slow BUG=635641 Change-Id: Ibfeda2ab32d10a8a4e229a428a846ce9809e8dcd Reviewed-on: https://chromium-review.googlesource.com/444094 Reviewed-by: Daniel Jacques Commit-Queue: Ryan Tseng --- recipe_modules/bot_update/api.py | 5 +++++ recipe_modules/bot_update/example.expected/basic.json | 2 ++ .../bot_update/example.expected/basic_output_manifest.json | 2 ++ .../bot_update/example.expected/basic_with_branch_heads.json | 2 ++ recipe_modules/bot_update/example.expected/buildbot.json | 2 ++ recipe_modules/bot_update/example.expected/clobber.json | 2 ++ .../example.expected/gerrit_no_rebase_patch_ref.json | 2 ++ .../bot_update/example.expected/gerrit_no_reset.json | 2 ++ recipe_modules/bot_update/example.expected/no_shallow.json | 2 ++ .../example.expected/reset_root_solution_revision.json | 2 ++ recipe_modules/bot_update/example.expected/trychange.json | 2 ++ .../example.expected/trychange_oauth2_buildbot.json | 2 ++ .../bot_update/example.expected/trychange_oauth2_json.json | 2 ++ .../example.expected/trychange_oauth2_json_win.json | 2 ++ recipe_modules/bot_update/example.expected/tryjob.json | 2 ++ recipe_modules/bot_update/example.expected/tryjob_fail.json | 2 ++ .../bot_update/example.expected/tryjob_fail_patch.json | 2 ++ .../example.expected/tryjob_fail_patch_download.json | 2 ++ .../bot_update/example.expected/tryjob_gerrit_angle.json | 2 ++ .../example.expected/tryjob_gerrit_angle_deprecated.json | 2 ++ recipe_modules/bot_update/example.expected/tryjob_v8.json | 2 ++ .../example.expected/tryjob_v8_head_by_default.json | 2 ++ 22 files changed, 47 insertions(+) diff --git a/recipe_modules/bot_update/api.py b/recipe_modules/bot_update/api.py index c9ba6735f..505ac404d 100644 --- a/recipe_modules/bot_update/api.py +++ b/recipe_modules/bot_update/api.py @@ -37,6 +37,11 @@ class BotUpdateApi(recipe_api.RecipeApi): kwargs['env'].setdefault('PATH', '%(PATH)s') kwargs['env']['PATH'] = self.m.path.pathsep.join([ kwargs['env']['PATH'], str(self._module.PACKAGE_REPO_ROOT)]) + # These are to prevent git from hanging. If the git connection is slower + # than 1KB/s for more than 5 minutes then git will kill the connection + # and die with an error "error: RPC failed; curl 28 Operation too slow" + kwargs['env']['GIT_HTTP_LOW_SPEED_LIMIT '] = 1000 + kwargs['env']['GIT_HTTP_LOW_SPEED_TIME'] = 300 return self.m.python(name, bot_update_path, cmd, **kwargs) @property diff --git a/recipe_modules/bot_update/example.expected/basic.json b/recipe_modules/bot_update/example.expected/basic.json index 75efd0a84..3f0931548 100644 --- a/recipe_modules/bot_update/example.expected/basic.json +++ b/recipe_modules/bot_update/example.expected/basic.json @@ -18,6 +18,8 @@ "src@abc" ], "env": { + "GIT_HTTP_LOW_SPEED_LIMIT ": "1000", + "GIT_HTTP_LOW_SPEED_TIME": "300", "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, "name": "bot_update (without patch)", diff --git a/recipe_modules/bot_update/example.expected/basic_output_manifest.json b/recipe_modules/bot_update/example.expected/basic_output_manifest.json index f333cf606..2e7cf4388 100644 --- a/recipe_modules/bot_update/example.expected/basic_output_manifest.json +++ b/recipe_modules/bot_update/example.expected/basic_output_manifest.json @@ -19,6 +19,8 @@ "--output_manifest" ], "env": { + "GIT_HTTP_LOW_SPEED_LIMIT ": "1000", + "GIT_HTTP_LOW_SPEED_TIME": "300", "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, "name": "bot_update", diff --git a/recipe_modules/bot_update/example.expected/basic_with_branch_heads.json b/recipe_modules/bot_update/example.expected/basic_with_branch_heads.json index b3c34c0ab..c40c5f476 100644 --- a/recipe_modules/bot_update/example.expected/basic_with_branch_heads.json +++ b/recipe_modules/bot_update/example.expected/basic_with_branch_heads.json @@ -19,6 +19,8 @@ "--with_branch_heads" ], "env": { + "GIT_HTTP_LOW_SPEED_LIMIT ": "1000", + "GIT_HTTP_LOW_SPEED_TIME": "300", "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, "name": "bot_update - with branch heads", diff --git a/recipe_modules/bot_update/example.expected/buildbot.json b/recipe_modules/bot_update/example.expected/buildbot.json index 75efd0a84..3f0931548 100644 --- a/recipe_modules/bot_update/example.expected/buildbot.json +++ b/recipe_modules/bot_update/example.expected/buildbot.json @@ -18,6 +18,8 @@ "src@abc" ], "env": { + "GIT_HTTP_LOW_SPEED_LIMIT ": "1000", + "GIT_HTTP_LOW_SPEED_TIME": "300", "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, "name": "bot_update (without patch)", diff --git a/recipe_modules/bot_update/example.expected/clobber.json b/recipe_modules/bot_update/example.expected/clobber.json index 0f511633e..1581ed5f1 100644 --- a/recipe_modules/bot_update/example.expected/clobber.json +++ b/recipe_modules/bot_update/example.expected/clobber.json @@ -19,6 +19,8 @@ "--clobber" ], "env": { + "GIT_HTTP_LOW_SPEED_LIMIT ": "1000", + "GIT_HTTP_LOW_SPEED_TIME": "300", "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, "name": "bot_update", diff --git a/recipe_modules/bot_update/example.expected/gerrit_no_rebase_patch_ref.json b/recipe_modules/bot_update/example.expected/gerrit_no_rebase_patch_ref.json index cbaab11c6..5631a02aa 100644 --- a/recipe_modules/bot_update/example.expected/gerrit_no_rebase_patch_ref.json +++ b/recipe_modules/bot_update/example.expected/gerrit_no_rebase_patch_ref.json @@ -19,6 +19,8 @@ "--gerrit_no_rebase_patch_ref" ], "env": { + "GIT_HTTP_LOW_SPEED_LIMIT ": "1000", + "GIT_HTTP_LOW_SPEED_TIME": "300", "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, "name": "bot_update", diff --git a/recipe_modules/bot_update/example.expected/gerrit_no_reset.json b/recipe_modules/bot_update/example.expected/gerrit_no_reset.json index 118998391..5ab7ddc4e 100644 --- a/recipe_modules/bot_update/example.expected/gerrit_no_reset.json +++ b/recipe_modules/bot_update/example.expected/gerrit_no_reset.json @@ -19,6 +19,8 @@ "--gerrit_no_reset" ], "env": { + "GIT_HTTP_LOW_SPEED_LIMIT ": "1000", + "GIT_HTTP_LOW_SPEED_TIME": "300", "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, "name": "bot_update", diff --git a/recipe_modules/bot_update/example.expected/no_shallow.json b/recipe_modules/bot_update/example.expected/no_shallow.json index 0c5ffe3e0..690d64f51 100644 --- a/recipe_modules/bot_update/example.expected/no_shallow.json +++ b/recipe_modules/bot_update/example.expected/no_shallow.json @@ -19,6 +19,8 @@ "--no_shallow" ], "env": { + "GIT_HTTP_LOW_SPEED_LIMIT ": "1000", + "GIT_HTTP_LOW_SPEED_TIME": "300", "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, "name": "bot_update", diff --git a/recipe_modules/bot_update/example.expected/reset_root_solution_revision.json b/recipe_modules/bot_update/example.expected/reset_root_solution_revision.json index 0d9fb489b..f667fa100 100644 --- a/recipe_modules/bot_update/example.expected/reset_root_solution_revision.json +++ b/recipe_modules/bot_update/example.expected/reset_root_solution_revision.json @@ -18,6 +18,8 @@ "src@revision" ], "env": { + "GIT_HTTP_LOW_SPEED_LIMIT ": "1000", + "GIT_HTTP_LOW_SPEED_TIME": "300", "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, "name": "bot_update", diff --git a/recipe_modules/bot_update/example.expected/trychange.json b/recipe_modules/bot_update/example.expected/trychange.json index 2a6e0ac39..670f67d2c 100644 --- a/recipe_modules/bot_update/example.expected/trychange.json +++ b/recipe_modules/bot_update/example.expected/trychange.json @@ -20,6 +20,8 @@ "+refs/change/1/2/333" ], "env": { + "GIT_HTTP_LOW_SPEED_LIMIT ": "1000", + "GIT_HTTP_LOW_SPEED_TIME": "300", "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, "name": "bot_update", diff --git a/recipe_modules/bot_update/example.expected/trychange_oauth2_buildbot.json b/recipe_modules/bot_update/example.expected/trychange_oauth2_buildbot.json index b0917d4bf..017abe669 100644 --- a/recipe_modules/bot_update/example.expected/trychange_oauth2_buildbot.json +++ b/recipe_modules/bot_update/example.expected/trychange_oauth2_buildbot.json @@ -22,6 +22,8 @@ "src@HEAD" ], "env": { + "GIT_HTTP_LOW_SPEED_LIMIT ": "1000", + "GIT_HTTP_LOW_SPEED_TIME": "300", "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, "name": "bot_update", diff --git a/recipe_modules/bot_update/example.expected/trychange_oauth2_json.json b/recipe_modules/bot_update/example.expected/trychange_oauth2_json.json index 772fc2d18..ca67ce172 100644 --- a/recipe_modules/bot_update/example.expected/trychange_oauth2_json.json +++ b/recipe_modules/bot_update/example.expected/trychange_oauth2_json.json @@ -20,6 +20,8 @@ "src@HEAD" ], "env": { + "GIT_HTTP_LOW_SPEED_LIMIT ": "1000", + "GIT_HTTP_LOW_SPEED_TIME": "300", "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, "name": "bot_update", diff --git a/recipe_modules/bot_update/example.expected/trychange_oauth2_json_win.json b/recipe_modules/bot_update/example.expected/trychange_oauth2_json_win.json index 3336ef0fc..a3d89d17b 100644 --- a/recipe_modules/bot_update/example.expected/trychange_oauth2_json_win.json +++ b/recipe_modules/bot_update/example.expected/trychange_oauth2_json_win.json @@ -20,6 +20,8 @@ "src@HEAD" ], "env": { + "GIT_HTTP_LOW_SPEED_LIMIT ": "1000", + "GIT_HTTP_LOW_SPEED_TIME": "300", "PATH": "%(PATH)s;RECIPE_PACKAGE_REPO[depot_tools]" }, "name": "bot_update", diff --git a/recipe_modules/bot_update/example.expected/tryjob.json b/recipe_modules/bot_update/example.expected/tryjob.json index ee56bb199..d0b796240 100644 --- a/recipe_modules/bot_update/example.expected/tryjob.json +++ b/recipe_modules/bot_update/example.expected/tryjob.json @@ -24,6 +24,8 @@ "src@HEAD" ], "env": { + "GIT_HTTP_LOW_SPEED_LIMIT ": "1000", + "GIT_HTTP_LOW_SPEED_TIME": "300", "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, "name": "bot_update", diff --git a/recipe_modules/bot_update/example.expected/tryjob_fail.json b/recipe_modules/bot_update/example.expected/tryjob_fail.json index 7f720ab35..3cd8f88e7 100644 --- a/recipe_modules/bot_update/example.expected/tryjob_fail.json +++ b/recipe_modules/bot_update/example.expected/tryjob_fail.json @@ -24,6 +24,8 @@ "src@HEAD" ], "env": { + "GIT_HTTP_LOW_SPEED_LIMIT ": "1000", + "GIT_HTTP_LOW_SPEED_TIME": "300", "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, "name": "bot_update", diff --git a/recipe_modules/bot_update/example.expected/tryjob_fail_patch.json b/recipe_modules/bot_update/example.expected/tryjob_fail_patch.json index ed3caebc5..b552f7dd4 100644 --- a/recipe_modules/bot_update/example.expected/tryjob_fail_patch.json +++ b/recipe_modules/bot_update/example.expected/tryjob_fail_patch.json @@ -24,6 +24,8 @@ "src@HEAD" ], "env": { + "GIT_HTTP_LOW_SPEED_LIMIT ": "1000", + "GIT_HTTP_LOW_SPEED_TIME": "300", "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, "name": "bot_update", diff --git a/recipe_modules/bot_update/example.expected/tryjob_fail_patch_download.json b/recipe_modules/bot_update/example.expected/tryjob_fail_patch_download.json index 4328d4b90..e0c1418df 100644 --- a/recipe_modules/bot_update/example.expected/tryjob_fail_patch_download.json +++ b/recipe_modules/bot_update/example.expected/tryjob_fail_patch_download.json @@ -24,6 +24,8 @@ "src@HEAD" ], "env": { + "GIT_HTTP_LOW_SPEED_LIMIT ": "1000", + "GIT_HTTP_LOW_SPEED_TIME": "300", "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, "name": "bot_update", diff --git a/recipe_modules/bot_update/example.expected/tryjob_gerrit_angle.json b/recipe_modules/bot_update/example.expected/tryjob_gerrit_angle.json index 4d1d7b89a..7112a2b38 100644 --- a/recipe_modules/bot_update/example.expected/tryjob_gerrit_angle.json +++ b/recipe_modules/bot_update/example.expected/tryjob_gerrit_angle.json @@ -24,6 +24,8 @@ "src/third_party/angle@HEAD" ], "env": { + "GIT_HTTP_LOW_SPEED_LIMIT ": "1000", + "GIT_HTTP_LOW_SPEED_TIME": "300", "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, "name": "bot_update", diff --git a/recipe_modules/bot_update/example.expected/tryjob_gerrit_angle_deprecated.json b/recipe_modules/bot_update/example.expected/tryjob_gerrit_angle_deprecated.json index 4d1d7b89a..7112a2b38 100644 --- a/recipe_modules/bot_update/example.expected/tryjob_gerrit_angle_deprecated.json +++ b/recipe_modules/bot_update/example.expected/tryjob_gerrit_angle_deprecated.json @@ -24,6 +24,8 @@ "src/third_party/angle@HEAD" ], "env": { + "GIT_HTTP_LOW_SPEED_LIMIT ": "1000", + "GIT_HTTP_LOW_SPEED_TIME": "300", "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, "name": "bot_update", diff --git a/recipe_modules/bot_update/example.expected/tryjob_v8.json b/recipe_modules/bot_update/example.expected/tryjob_v8.json index 105604bc7..654c1eae5 100644 --- a/recipe_modules/bot_update/example.expected/tryjob_v8.json +++ b/recipe_modules/bot_update/example.expected/tryjob_v8.json @@ -26,6 +26,8 @@ "src/v8@abc" ], "env": { + "GIT_HTTP_LOW_SPEED_LIMIT ": "1000", + "GIT_HTTP_LOW_SPEED_TIME": "300", "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, "name": "bot_update", diff --git a/recipe_modules/bot_update/example.expected/tryjob_v8_head_by_default.json b/recipe_modules/bot_update/example.expected/tryjob_v8_head_by_default.json index ed4352e21..8eb316bd7 100644 --- a/recipe_modules/bot_update/example.expected/tryjob_v8_head_by_default.json +++ b/recipe_modules/bot_update/example.expected/tryjob_v8_head_by_default.json @@ -26,6 +26,8 @@ "src/v8@HEAD" ], "env": { + "GIT_HTTP_LOW_SPEED_LIMIT ": "1000", + "GIT_HTTP_LOW_SPEED_TIME": "300", "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]" }, "name": "bot_update",