[pbs-devel] [PATCH proxmox-backup/pve-container 0/5] improve error handling of pxar extractor

Max Carrara m.carrara at proxmox.com
Wed Jun 7 18:34:23 CEST 2023


The goal of this series is to improve how errors occurring during
the extraction of pxar archives are propagated and handled.

This is mainly done through leveraging the `anyhow::Context` trait [0],
which makes it possible to provide and propagate context-dependent error
information (hence its name), while simultaneously preserving the
original error that caused an execution path to fail in the first place.

Furthermore, the existing error handler and its related mechanisms
are now also used during the overall process of extraction.
Together with the introduction of a new type of context variable,
errors that happen during the extraction can now be handled for each
type of entry individually (if desired).

This is demonstrated by adding a new flag to the `proxmox-backup-client`
CLI tool, which appends a handler that ignores errors which occur
during the extraction of a device node. This also fixes #3460. [1] 

[0]: https://docs.rs/anyhow/latest/anyhow/trait.Context.html
[1]: https://bugzilla.proxmox.com/show_bug.cgi?id=3460


proxmox-backup:

Max Carrara (4):
  pbs-client: pxar: preserve error context
  pbs-client: pxar: refactor body of `extract_archive` to
    `ExtractorIter`
  pbs-client: pxar: add `PxarExtractContext`
  proxmox-backup-client: restore: add 'ignore-extract-device-errors'
    flag

 pbs-client/src/pxar/create.rs     |  22 +-
 pbs-client/src/pxar/dir_stack.rs  |   8 +-
 pbs-client/src/pxar/extract.rs    | 573 +++++++++++++++++++++---------
 pbs-client/src/pxar/metadata.rs   |  44 +--
 pbs-client/src/pxar/mod.rs        |   2 +-
 pbs-client/src/pxar/tools.rs      |  13 +-
 proxmox-backup-client/src/main.rs |  61 +++-
 7 files changed, 505 insertions(+), 218 deletions(-)


pve-container:

Max Carrara (1):
  fix #3460: restore: honor '--ignore-unpack-errors' flag for pbs

 src/PVE/LXC/Create.pm | 4 ++++
 1 file changed, 4 insertions(+)
-- 
2.30.2






More information about the pbs-devel mailing list