@@ -184,7 +184,40 @@ impl Task {
184184 . insert ( self . krate . clone ( ) , storage. clone ( ) ) ;
185185 logging:: capture ( & storage, || {
186186 let rustwide_crate = self . krate . to_rustwide ( ) ;
187- detect_broken ( rustwide_crate. fetch ( workspace) ) ?;
187+ for attempt in 1 ..=15 {
188+ match detect_broken ( rustwide_crate. fetch ( workspace) ) {
189+ Ok ( ( ) ) => { }
190+ Err ( e) => {
191+ if storage. to_string ( ) . contains ( "No space left on device" ) {
192+ if attempt == 15 {
193+ // If we've failed 15 times, then
194+ // just give up. It's been at least
195+ // 45 seconds, which is enough that
196+ // our disk space check should
197+ // have run at least once in this
198+ // time. If that's not helped, then
199+ // maybe this git repository *is*
200+ // actually too big.
201+ //
202+ // Ideally we'd have some kind of
203+ // per-worker counter and if we hit
204+ // this too often we'd replace the
205+ // machine, but it's not very clear
206+ // what "too often" means here.
207+ return Err ( e) ;
208+ } else {
209+ log:: warn!(
210+ "Retrying crate fetch in 3 seconds (attempt {})" ,
211+ attempt
212+ ) ;
213+ std:: thread:: sleep ( std:: time:: Duration :: from_secs ( 3 ) ) ;
214+ }
215+ } else {
216+ return Err ( e) ;
217+ }
218+ }
219+ }
220+ }
188221
189222 if let Crate :: GitHub ( repo) = & self . krate {
190223 if let Some ( sha) = rustwide_crate. git_commit ( workspace) {
0 commit comments