我在我的Jenkins中創建了一個將git存儲庫(在web上)複製到本地(intranet)git的作業設置。它在99%的時間內工作,沒有任何問題。Jenkins未能在git連接失敗中放棄作業
但時不時地,因爲我們的互聯網連接不是很好,它無法連接到遠程存儲庫。問題不完全在連接問題,這是給定的。問題在於詹金斯如何處理它。
它現在設置爲每15分鐘運行一次以查找遠程回購中的更改。 (我們還沒有設置webhook)十次中有九次不會有,並且以「沒有更改 - 確定」結束。
當互聯網連接不好的時候,git上的查詢將會超時,但不會中止工作,並在15分鐘後再次運行它,它會變得瘋狂並嘗試下載整個repo,這接近200mb在規模上,當然它會崩潰,因爲 - 那個時候的連接並不好。最壞的部分?這個工作不會再運行,直到我手動這樣做。
有關如何解決此問題的任何提示?下面是顯示詹金斯怪異行爲的日誌。
16:30:09 > git fetch --tags --progress https://[email protected]/yyy/mmmmm.git +refs/heads/*:refs/remotes/origin/*
16:40:09 ERROR: Timeout after 10 minutes
16:40:09 ERROR: Error cloning remote repo 'origin'
16:40:10 hudson.plugins.git.GitException: Command "git fetch --tags --progress https://[email protected]/yyy/mmmmm.git +refs/heads/*:refs/remotes/origin/*" returned status code 143:
16:40:10 stdout:
16:40:10 stderr: remote: Counting objects: 45507, done.
16:40:10 remote: Compressing objects: 0% (1/397)
remote: Compressing objects: 1% (4/397)
remote: Compressing objects: 2% (8/397)
remote: Compressing objects: 3% (12/397)
remote: Compressing objects: 4% (16/397)
[...]
Receiving objects: 54% (24849/45507), 83.98 MiB | 82.00 KiB/s
Receiving objects: 54% (24849/45507), 84.04 MiB | 84.00 KiB/s
16:40:10 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1799)
16:40:10 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1525)
16:40:10 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:65)