* [pbs-devel] [PATCH proxmox-backup] pxar/create: handle ErrorKind::Interrupted for file reads
@ 2020-11-05 8:29 Dominik Csapak
2020-11-05 9:34 ` [pbs-devel] applied: " Wolfgang Bumiller
0 siblings, 1 reply; 2+ messages in thread
From: Dominik Csapak @ 2020-11-05 8:29 UTC (permalink / raw)
To: pbs-devel
they are not an error and we should retry the read
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
src/pxar/create.rs | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/pxar/create.rs b/src/pxar/create.rs
index f4c735d0..6fe820bd 100644
--- a/src/pxar/create.rs
+++ b/src/pxar/create.rs
@@ -657,7 +657,11 @@ impl<'a, 'b> Archiver<'a, 'b> {
let mut remaining = file_size;
let mut out = encoder.create_file(metadata, file_name, file_size)?;
while remaining != 0 {
- let mut got = file.read(&mut self.file_copy_buffer[..])?;
+ let mut got = match file.read(&mut self.file_copy_buffer[..]) {
+ Ok(got) => got,
+ Err(err) if err.kind() == std::io::ErrorKind::Interrupted => continue,
+ Err(err) => bail!(err),
+ };
if got as u64 > remaining {
self.report_file_grew_while_reading()?;
got = remaining as usize;
--
2.20.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* [pbs-devel] applied: [PATCH proxmox-backup] pxar/create: handle ErrorKind::Interrupted for file reads
2020-11-05 8:29 [pbs-devel] [PATCH proxmox-backup] pxar/create: handle ErrorKind::Interrupted for file reads Dominik Csapak
@ 2020-11-05 9:34 ` Wolfgang Bumiller
0 siblings, 0 replies; 2+ messages in thread
From: Wolfgang Bumiller @ 2020-11-05 9:34 UTC (permalink / raw)
To: Dominik Csapak; +Cc: pbs-devel
applied
On Thu, Nov 05, 2020 at 09:29:06AM +0100, Dominik Csapak wrote:
> they are not an error and we should retry the read
>
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
> src/pxar/create.rs | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/src/pxar/create.rs b/src/pxar/create.rs
> index f4c735d0..6fe820bd 100644
> --- a/src/pxar/create.rs
> +++ b/src/pxar/create.rs
> @@ -657,7 +657,11 @@ impl<'a, 'b> Archiver<'a, 'b> {
> let mut remaining = file_size;
> let mut out = encoder.create_file(metadata, file_name, file_size)?;
> while remaining != 0 {
> - let mut got = file.read(&mut self.file_copy_buffer[..])?;
> + let mut got = match file.read(&mut self.file_copy_buffer[..]) {
> + Ok(got) => got,
> + Err(err) if err.kind() == std::io::ErrorKind::Interrupted => continue,
> + Err(err) => bail!(err),
> + };
> if got as u64 > remaining {
> self.report_file_grew_while_reading()?;
> got = remaining as usize;
> --
> 2.20.1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-11-05 9:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-05 8:29 [pbs-devel] [PATCH proxmox-backup] pxar/create: handle ErrorKind::Interrupted for file reads Dominik Csapak
2020-11-05 9:34 ` [pbs-devel] applied: " Wolfgang Bumiller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal