@xen-orchestra/backups 0.52.0 → 0.52.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/_backupWorker.mjs CHANGED
@@ -23,7 +23,7 @@ createCachedLookup().patchGlobal()
23
23
 
24
24
  const logger = createLogger('xo:backups:worker')
25
25
  catchGlobalErrors(logger)
26
- const { debug, info } = logger
26
+ const { debug, info, warn } = logger
27
27
 
28
28
  class BackupWorker {
29
29
  #config
@@ -204,6 +204,13 @@ process.on('message', async message => {
204
204
  info('backup has ended')
205
205
  await ignoreErrors.call(backupWorker.debounceResource.flushAll())
206
206
  process.disconnect()
207
+
208
+ setTimeout(() => {
209
+ warn('worker process did not exit automatically, forcing...')
210
+
211
+ // eslint-disable-next-line n/no-process-exit
212
+ process.exit()
213
+ }, 30e3).unref()
207
214
  }
208
215
  }
209
216
  })
@@ -264,7 +264,9 @@ export const AbstractXapi = class AbstractXapiVmBackupRunner extends Abstract {
264
264
  }
265
265
  })
266
266
  })
267
+ }
267
268
 
269
+ async _removeSnapshotData() {
268
270
  // now that we use CBT, we can destroy the data of the snapshot used for this backup
269
271
  // going back to a previous version of XO not supporting CBT will create a full backup
270
272
  // this will only do something after snapshot and transfer
@@ -280,12 +282,12 @@ export const AbstractXapi = class AbstractXapiVmBackupRunner extends Abstract {
280
282
  this._settings.cbtDestroySnapshotData
281
283
  ) {
282
284
  Task.info('will delete snapshot data')
283
- const vdiRefs = await this._xapi.VM_getDisks(this._exportedVm?.$ref)
284
- await xapi.call('VM.destroy', this._exportedVm.$ref)
285
+ const vdiRefs = await this._xapi.VM_getDisks(this._exportedVm.$ref)
286
+ await this._xapi.call('VM.destroy', this._exportedVm.$ref)
285
287
  for (const vdiRef of vdiRefs) {
286
288
  try {
287
289
  // data_destroy will fail with a VDI_NO_CBT_METADATA error if CBT is not enabled on this VDI
288
- await xapi.call('VDI.data_destroy', vdiRef)
290
+ await this._xapi.call('VDI.data_destroy', vdiRef)
289
291
  Task.info(`Snapshot data has been deleted`, { vdiRef })
290
292
  } catch (error) {
291
293
  Task.warning(`Couldn't deleted snapshot data`, { error, vdiRef })
@@ -373,6 +375,7 @@ export const AbstractXapi = class AbstractXapiVmBackupRunner extends Abstract {
373
375
 
374
376
  await this._fetchJobSnapshots()
375
377
  await this._removeUnusedSnapshots()
378
+ await this._removeSnapshotData()
376
379
  }
377
380
  await this._healthCheck()
378
381
  }
@@ -140,6 +140,7 @@ export class IncrementalRemoteWriter extends MixinRemoteWriter(AbstractIncrement
140
140
  if (isDifferencing) {
141
141
  assert.notStrictEqual(
142
142
  parentVdiPaths,
143
+ undefined,
143
144
  'checkbasevdi must be called before updateUuidAndChain for incremental backups'
144
145
  )
145
146
  const parentPath = parentVdiPaths[dirname(path)]
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "type": "git",
9
9
  "url": "https://github.com/vatesfr/xen-orchestra.git"
10
10
  },
11
- "version": "0.52.0",
11
+ "version": "0.52.2",
12
12
  "engines": {
13
13
  "node": ">=14.18"
14
14
  },
@@ -25,7 +25,7 @@
25
25
  "@vates/decorate-with": "^2.1.0",
26
26
  "@vates/disposable": "^0.1.5",
27
27
  "@vates/fuse-vhd": "^2.1.1",
28
- "@vates/nbd-client": "^3.0.2",
28
+ "@vates/nbd-client": "^3.1.0",
29
29
  "@vates/parse-duration": "^0.1.1",
30
30
  "@xen-orchestra/async-map": "^0.1.2",
31
31
  "@xen-orchestra/fs": "^4.1.7",
@@ -47,7 +47,7 @@
47
47
  "tar": "^6.1.15",
48
48
  "uuid": "^9.0.0",
49
49
  "vhd-lib": "^4.11.0",
50
- "xen-api": "^4.0.0",
50
+ "xen-api": "^4.2.0",
51
51
  "yazl": "^2.5.1"
52
52
  },
53
53
  "devDependencies": {
@@ -58,7 +58,7 @@
58
58
  "tmp": "^0.2.1"
59
59
  },
60
60
  "peerDependencies": {
61
- "@xen-orchestra/xapi": "^7.0.0"
61
+ "@xen-orchestra/xapi": "^7.2.1"
62
62
  },
63
63
  "license": "AGPL-3.0-or-later",
64
64
  "author": {