The cloning may take a very long time, 2.5 hours for example, usally
it should be done in server minutes. If it really very slow, there
maybe something wrong with the current socket connections, retry it
maybe fixed.
This fixing will timeout the clone command after 30m, and retry it
by doubling the timeout value.
Fixes: https://tracker.ceph.com/issues/50021
Signed-off-by: Xiubo Li <xiubli@redhat.com>
set -e
-git clone git://git.ceph.com/ceph.git
+# try it again if the clone is slow and the second time
+retried=false
+trap -- 'retry' EXIT
+retry() {
+ rm -rf ceph
+ # double the timeout value
+ timeout 3600 git clone git://git.ceph.com/ceph.git
+}
+rm -rf ceph
+timeout 1800 git clone git://git.ceph.com/ceph.git
+trap - EXIT
cd ceph
versions=`seq 1 21`