@@ -570,11 +570,11 @@ (let* ((fullname (conc "logs/" file))) (if (directory? fullname) (debug:print-info 0 *default-log-port* fullname " in logs directory is a directory! Cannot rotate it, it is best to not put subdirectories in the logs dir.") (handle-exceptions exn - (debug:print-error 0 *default-log-port* "failed to remove " fullname ", exn=" exn) + (debug:print-info 0 *default-log-port* "failed to remove " fullname ", exn=" exn) (delete-file* fullname))))) files) (debug:print-info 0 *default-log-port* "Deleted " (length files) " files from logs, keeping " max-allowed " files.")))))) ;; Force a megatest cleanup-db if version is changed and skip-version-check not specified @@ -1315,25 +1315,32 @@ (debug:print-info 0 *default-log-port* "using testpatt " args-testpatt " rtestpatt:" rtestpatt) args-testpatt)))) -(define (common:false-on-exception thunk #!key (message #f)) - (handle-exceptions exn +;; +(define (common:false-on-exception thunk #!key (message #f)(tries 1)) + (handle-exceptions + exn (begin (if message - (debug:print-info 0 *default-log-port* message)) - #f) (thunk) )) - -(define (common:file-exists? path-string #!key (silent #f)) - ;; this avoids stack dumps in the case where - - ;;;; TODO: catch permission denied exceptions and emit appropriate warnings, eg: system error while trying to access file: "/nfs/pdx/disks/icf_env_disk001/bjbarcla/gwa/issues/mtdev/randy-slow/reproduce/q... - (common:false-on-exception (lambda () (file-exists? path-string)) + (debug:print-info 0 *default-log-port* message " exn=" exn)) + (if (> tries 1) + (begin + (thread-sleep! 1) + (common:false-on-exception thunk message: message tries: (- tries 1))) + #f)) + (thunk))) + +(define (common:file-exists? path-string #!key (silent #f)(tries 1)) + ;; this avoids stack dumps in the case where NFS is slow or flakey + (common:false-on-exception + (lambda ()(file-exists? path-string)) message: (if (not silent) (conc "Unable to access path: " path-string) #f) + tries: tries )) (define (common:directory-exists? path-string) ;;;; TODO: catch permission denied exceptions and emit appropriate warnings, eg: system error while trying to access file: "/nfs/pdx/disks/icf_env_disk001/bjbarcla/gwa/issues/mtdev/randy-slow/reproduce/q... (common:false-on-exception (lambda () (directory-exists? path-string))