{"thread":{"id":"45831","subject":"[PATCH v1] travis-ci: retry if Git for Windows CI returns HTTP error 502 or 503","startedAt":"2017-04-29T18:48:29Z","lastAt":"2017-05-02T10:27:26Z","messageCount":4,"participants":["Lars Schneider","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"318243","messageId":"20170429184822.10128-1-larsxschneider@gmail.com","threadId":"45831","inReplyTo":null,"subject":"[PATCH v1] travis-ci: retry if Git for Windows CI returns HTTP error 502 or 503","fromName":"Lars Schneider","fromEmail":"larsxschneider@gmail.com","sentAt":"2017-04-29T18:48:22Z","receivedAt":"2017-04-29T18:48:29Z","isPatch":true,"sender":{"key":"larsxschneider@gmail.com","avatar":"https://avatars.githubusercontent.com/u/477434?v=4"},"body":"The Git for Windows CI web app sometimes returns HTTP errors of\n\"502 bad gateway\" or \"503 service unavailable\" [1]. Wait a little and\nretry the request if this happens.\n\n[1] https://docs.microsoft.com/en-in/azure/app-service-web/app-service-web-troubleshoot-http-502-http-503\n\nSigned-off-by: Lars Schneider <larsxschneider@gmail.com>\n---\n\nHi,\n\nthis should make the Git for Windows build a bit more stable. We saw\na few 502's recently. E.g. https://travis-ci.org/git/git/jobs/226669324\n\nI did not add any checks to avoid an endless loop because TravisCI would\nshutdown the worker if there is no output for more than 10min. Therefore\nI think we don't need to handle this case ourselves.\n\nCheers,\nLars\n\nNotes:\n    Base Ref: next\n    Web-Diff: https://github.com/larsxschneider/git/commit/b57ebf31ab\n    Checkout: git fetch https://github.com/larsxschneider/git travisci/win-retry-v1 && git checkout b57ebf31ab\n\n ci/run-windows-build.sh | 12 ++++++++++++\n 1 file changed, 12 insertions(+)\n\ndiff --git a/ci/run-windows-build.sh b/ci/run-windows-build.sh\nindex e043440799..7a9aa9c6a7 100755\n--- a/ci/run-windows-build.sh\n+++ b/ci/run-windows-build.sh\n@@ -15,6 +15,8 @@ COMMIT=$2\n gfwci () {\n \tlocal CURL_ERROR_CODE HTTP_CODE\n \texec 3>&1\n+\twhile test -z $HTTP_CODE\n+\tdo\n \tHTTP_CODE=$(curl \\\n \t\t-H \"Authentication: Bearer $GFW_CI_TOKEN\" \\\n \t\t--silent --retry 5 --write-out '%{HTTP_CODE}' \\\n@@ -22,6 +24,16 @@ gfwci () {\n \t\t\"https://git-for-windows-ci.azurewebsites.net/api/TestNow?$1\" \\\n \t)\n \tCURL_ERROR_CODE=$?\n+\t\t# The GfW CI web app sometimes returns HTTP errors of\n+\t\t# \"502 bad gateway\" or \"503 service unavailable\".\n+\t\t# Wait a little and retry if it happens. More info:\n+\t\t# https://docs.microsoft.com/en-in/azure/app-service-web/app-service-web-troubleshoot-http-502-http-503\n+\t\tif test $HTTP_CODE -eq 502 || test $HTTP_CODE -eq 503\n+\t\tthen\n+\t\t\tsleep 10\n+\t\t\tHTTP_CODE=\n+\t\tfi\n+\tdone\n \tif test $CURL_ERROR_CODE -ne 0\n \tthen\n \t\treturn $CURL_ERROR_CODE\n\nbase-commit: 1ea7e62026c5dde4d8be80b2544696fc6aa70121\n--\n2.12.2\n\n"},{"id":"318362","messageId":"C434AB60-F2BB-44A1-B40D-449EA27E2314@gmail.com","threadId":"45831","inReplyTo":"20170429184822.10128-1-larsxschneider@gmail.com","subject":"Re: [PATCH v1] travis-ci: retry if Git for Windows CI returns HTTP error 502 or 503","fromName":"Lars Schneider","fromEmail":"larsxschneider@gmail.com","sentAt":"2017-05-01T11:32:27Z","receivedAt":"2017-05-01T11:36:32Z","isPatch":true,"sender":{"key":"larsxschneider@gmail.com","avatar":"https://avatars.githubusercontent.com/u/477434?v=4"},"body":"\n> On 29 Apr 2017, at 20:48, Lars Schneider <larsxschneider@gmail.com> wrote:\n> \n> The Git for Windows CI web app sometimes returns HTTP errors of\n> \"502 bad gateway\" or \"503 service unavailable\" [1]. Wait a little and\n> retry the request if this happens.\n> \n> [1] https://docs.microsoft.com/en-in/azure/app-service-web/app-service-web-troubleshoot-http-502-http-503\n> \n> Signed-off-by: Lars Schneider <larsxschneider@gmail.com>\n> ---\n> \n> Hi,\n> \n> this should make the Git for Windows build a bit more stable. We saw\n> a few 502's recently. E.g. https://travis-ci.org/git/git/jobs/226669324\n> \n> I did not add any checks to avoid an endless loop because TravisCI would\n> shutdown the worker if there is no output for more than 10min. Therefore\n> I think we don't need to handle this case ourselves.\n> \n> Cheers,\n> Lars\n> \n> Notes:\n>    Base Ref: next\n>    Web-Diff: https://github.com/larsxschneider/git/commit/b57ebf31ab\n>    Checkout: git fetch https://github.com/larsxschneider/git travisci/win-retry-v1 && git checkout b57ebf31ab\n> \n> ci/run-windows-build.sh | 12 ++++++++++++\n> 1 file changed, 12 insertions(+)\n> \n> diff --git a/ci/run-windows-build.sh b/ci/run-windows-build.sh\n> index e043440799..7a9aa9c6a7 100755\n> --- a/ci/run-windows-build.sh\n> +++ b/ci/run-windows-build.sh\n> @@ -15,6 +15,8 @@ COMMIT=$2\n> gfwci () {\n> \tlocal CURL_ERROR_CODE HTTP_CODE\n> \texec 3>&1\n> +\twhile test -z $HTTP_CODE\n> +\tdo\n> \tHTTP_CODE=$(curl \\\n> \t\t-H \"Authentication: Bearer $GFW_CI_TOKEN\" \\\n> \t\t--silent --retry 5 --write-out '%{HTTP_CODE}' \\\n> @@ -22,6 +24,16 @@ gfwci () {\n> \t\t\"https://git-for-windows-ci.azurewebsites.net/api/TestNow?$1\" \\\n> \t)\n> \tCURL_ERROR_CODE=$?\n> +\t\t# The GfW CI web app sometimes returns HTTP errors of\n> +\t\t# \"502 bad gateway\" or \"503 service unavailable\".\n> +\t\t# Wait a little and retry if it happens. More info:\n> +\t\t# https://docs.microsoft.com/en-in/azure/app-service-web/app-service-web-troubleshoot-http-502-http-503\n> +\t\tif test $HTTP_CODE -eq 502 || test $HTTP_CODE -eq 503\n> +\t\tthen\n> +\t\t\tsleep 10\n> +\t\t\tHTTP_CODE=\n> +\t\tfi\n> +\tdone\n\nPlease don't move this to next, yet. This seems not to work as expected :-(\nhttps://travis-ci.org/git/git/jobs/227513693\n\n- Lars"},{"id":"318480","messageId":"CAPc5daUOQVu66RDspzScUjufJvLs7TUS0UtqTZjJ=5sMBuF=TQ@mail.gmail.com","threadId":"45831","inReplyTo":"C434AB60-F2BB-44A1-B40D-449EA27E2314@gmail.com","subject":"Re: [PATCH v1] travis-ci: retry if Git for Windows CI returns HTTP error 502 or 503","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-05-02T09:52:01Z","receivedAt":"2017-05-02T09:52:27Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"On Mon, May 1, 2017 at 8:32 PM, Lars Schneider <larsxschneider@gmail.com> wrote:\n>>\n>> this should make the Git for Windows build a bit more stable. We saw\n>> a few 502's recently. E.g. https://travis-ci.org/git/git/jobs/226669324\n>>\n> Please don't move this to next, yet. This seems not to work as expected :-(\n> https://travis-ci.org/git/git/jobs/227513693\n\nSure. I am wondering if your other one to run both asciidoc & asciidoctor\ntee'ed to log files should be ready to work on 'next', though.\n\nThanks.\n"},{"id":"318482","messageId":"7A4862C2-6414-481B-974E-7BEF85611395@gmail.com","threadId":"45831","inReplyTo":"CAPc5daUOQVu66RDspzScUjufJvLs7TUS0UtqTZjJ=5sMBuF=TQ@mail.gmail.com","subject":"Re: [PATCH v1] travis-ci: retry if Git for Windows CI returns HTTP error 502 or 503","fromName":"Lars Schneider","fromEmail":"larsxschneider@gmail.com","sentAt":"2017-05-02T10:27:10Z","receivedAt":"2017-05-02T10:27:26Z","isPatch":true,"sender":{"key":"larsxschneider@gmail.com","avatar":"https://avatars.githubusercontent.com/u/477434?v=4"},"body":"\n> On 02 May 2017, at 11:52, Junio C Hamano <gitster@pobox.com> wrote:\n> \n> On Mon, May 1, 2017 at 8:32 PM, Lars Schneider <larsxschneider@gmail.com> wrote:\n>>> \n>>> this should make the Git for Windows build a bit more stable. We saw\n>>> a few 502's recently. E.g. https://travis-ci.org/git/git/jobs/226669324\n>>> \n>> Please don't move this to next, yet. This seems not to work as expected :-(\n>> https://travis-ci.org/git/git/jobs/227513693\n> \n> Sure. I am wondering if your other one to run both asciidoc & asciidoctor\n> tee'ed to log files should be ready to work on 'next', though.\n\nThe asciidoc changes are good to go from my point of view:\nhttps://travis-ci.org/git/git/jobs/227822259\n\n- Lars"}]}