Skip to content

Commit a738acd

Browse files
authored
Merge pull request #2728 from rbtcollins/chunkedio
Fix deferred incremental file creation
2 parents 59fa417 + 2263be1 commit a738acd

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

src/dist/component/package.rs

+17-9
Original file line numberDiff line numberDiff line change
@@ -489,12 +489,18 @@ fn unpack_without_first_dir<'a, R: Read>(
489489
continue;
490490
}
491491
Some(DirStatus::Exists) => {
492-
break item;
492+
break Some(item);
493493
}
494494
Some(DirStatus::Pending(pending)) => {
495-
// Parent dir is being made, take next item from tar
495+
// Parent dir is being made
496496
pending.push(item);
497-
continue 'entries;
497+
if incremental_file_sender.is_none() {
498+
// take next item from tar
499+
continue 'entries;
500+
} else {
501+
// don't submit a new item for processing, but do be ready to feed data to the incremental file.
502+
break None;
503+
}
498504
}
499505
}
500506
} else {
@@ -503,12 +509,14 @@ fn unpack_without_first_dir<'a, R: Read>(
503509
}
504510
};
505511

506-
// Submit the new item
507-
for mut item in io_executor.execute(item).collect::<Vec<_>>() {
508-
// TODO capture metrics
509-
budget.reclaim(&item);
510-
filter_result(&mut item).chain_err(|| ErrorKind::ExtractingPackage)?;
511-
trigger_children(&*io_executor, &mut directories, &mut budget, item)?;
512+
if let Some(item) = item {
513+
// Submit the new item
514+
for mut item in io_executor.execute(item).collect::<Vec<_>>() {
515+
// TODO capture metrics
516+
budget.reclaim(&item);
517+
filter_result(&mut item).chain_err(|| ErrorKind::ExtractingPackage)?;
518+
trigger_children(&*io_executor, &mut directories, &mut budget, item)?;
519+
}
512520
}
513521

514522
let mut incremental_file_sender = incremental_file_sender

0 commit comments

Comments
 (0)