Skip to content

Commit

Permalink
Fix(Backup): show a warning in the task log if a writer fails, an err…
Browse files Browse the repository at this point in the history
…or if they all fails
  • Loading branch information
fbeauchamp committed Jun 3, 2022
1 parent 379e4d7 commit 15b2ecf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions @xen-orchestra/backups/_VmBackup.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ class VmBackup {
errors.push(error)
this.delete(writer)
warn(warnMessage, { error, writer: writer.constructor.name })
Task.warning(
`the writer ${writer.constructor.name} has failed the step ${warnMessage} with error ${error.message}. It won't be used anymore in this job execution.`
)
}
})
if (writers.size === 0) {
Expand Down Expand Up @@ -433,6 +436,7 @@ class VmBackup {
)

await this._callWriters(async writer => {
await Task.run({ name: 'beforeBackup' }, () => writer.beforeBackup())
await writer.beforeBackup()
$defer(async () => {
await writer.afterBackup()
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

> Users must be able to say: “I had this issue, happy to know it's fixed”
- [Backup] show a warning in the task log if a writer fails, an error if they all fail (PR [#6266](https://github.com/vatesfr/xen-orchestra/pull/6266))

### Packages to release

> When modifying a package, add it here with its release type.
Expand All @@ -26,6 +28,7 @@
<!--packages-start-->

- @xen-orchestra/xapi minor
- @xen-orchestra/backups minor
- xo-server patch

<!--packages-end-->

0 comments on commit 15b2ecf

Please sign in to comment.