File tree Expand file tree Collapse file tree 2 files changed +22
-4
lines changed
Expand file tree Collapse file tree 2 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -504,9 +504,10 @@ Configuration properties supported for basic jobs include:
504504 artefacts. If the size or modified time of a file changes while it is being
505505 uploaded, the job will fail. To relax this restriction, the ` % ` prefix may
506506 be used to signify that "this file is allowed to change while it is being
507- uploaded". This is used to make best effort uploads of diagnostic log files
508- for background processes which may continue running even though the job is
509- nominally complete; e.g.,
507+ uploaded". The ` % ` prefix will also ignore a file that is completely removed
508+ by a background process before it is able to be uploaded. This is used to
509+ make best effort uploads of diagnostic log files for background processes
510+ which may continue running even though the job is nominally complete; e.g.,
510511
511512 ``` bash
512513 # : output_rules = [
Original file line number Diff line number Diff line change 44
55use std:: collections:: HashSet ;
66use std:: fs;
7- use std:: io:: Read ;
7+ use std:: io:: { ErrorKind , Read } ;
88use std:: path:: { Path , PathBuf } ;
99
1010use tokio:: sync:: mpsc;
@@ -227,6 +227,23 @@ pub(crate) fn upload(
227227 let mut f = match fs:: File :: open ( & u. path ) {
228228 Ok ( f) => f,
229229 Err ( e) => {
230+ if change_ok && e. kind ( ) == ErrorKind :: NotFound {
231+ /*
232+ * If this file is marked as being a potentially
233+ * fluctuating log file, we'll allow it to be completely
234+ * absent without raising a fatal error. It may have
235+ * been removed by some background process between when
236+ * we scanned the file system and when we went to upload
237+ * it.
238+ */
239+ let msg = format ! (
240+ "file {:?} disappeared between scan and upload" ,
241+ u. path,
242+ ) ;
243+ upl. tx . send ( Activity :: Warning ( msg) ) . await . unwrap ( ) ;
244+ continue ;
245+ }
246+
230247 upl. tx
231248 . send ( Activity :: Error ( format ! (
232249 "open {:?} failed: {:?}" ,
You can’t perform that action at this time.
0 commit comments