File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -641,8 +641,21 @@ export async function mainAsync(params: GitParams | UserParams): Promise<void> {
641
641
await execAsync ( processCwd , "sudo umount " + downloadDir ) ;
642
642
}
643
643
catch ( e ) {
644
- await execAsync ( processCwd , `pstree -palT` ) ;
645
- throw e ;
644
+ // HACK: Sometimes the server lingers for a brief period, so retry.
645
+ // Obviously, it would be better to have a way to know when it is gone-gone,
646
+ // but Linux doesn't provide such a mechanism for non-child processes.
647
+ // (You can poll for a process with the given PID after sending a kill signal,
648
+ // but best practice is to guard against the possibility of a new process
649
+ // being given the same PID.)
650
+ try {
651
+ console . log ( "umount failed - trying again after delay" ) ;
652
+ await new Promise ( resolve => setTimeout ( resolve , 5000 ) ) ;
653
+ await execAsync ( processCwd , "sudo umount " + downloadDir ) ;
654
+ }
655
+ catch {
656
+ await execAsync ( processCwd , `pstree -palT` ) ;
657
+ throw e ;
658
+ }
646
659
}
647
660
}
648
661
}
You can’t perform that action at this time.
0 commit comments