fix(xo-server/backup-ng): handle timeouts larger than 596h (#4663)

Fixes #4662
This commit is contained in:
badrAZ
2019-11-15 15:06:57 +01:00
committed by Julien Fontanet
parent 5588a46366
commit 2e51c8a124
4 changed files with 9 additions and 1 deletions

View File

@@ -16,6 +16,7 @@
- [SDN controller] Prevent private network creation on bond slave PIF (Fixes https://github.com/xcp-ng/xcp/issues/300) (PR [4633](https://github.com/vatesfr/xen-orchestra/pull/4633))
- [Metadata backup] Fix failed backup reported as successful [#4596](https://github.com/vatesfr/xen-orchestra/issues/4596) (PR [#4598](https://github.com/vatesfr/xen-orchestra/pull/4598))
- [Backup NG] Fix "task cancelled" error when the backup job timeout exceeds 596 hours [#4662](https://github.com/vatesfr/xen-orchestra/issues/4662) (PR [#4663](https://github.com/vatesfr/xen-orchestra/pull/4663))
### Released packages

View File

@@ -115,6 +115,7 @@
"split-lines": "^2.0.0",
"stack-chain": "^2.0.0",
"stoppable": "^1.0.5",
"strict-timeout": "^1.0.0",
"struct-fu": "^1.2.0",
"tar-stream": "^2.0.1",
"through2": "^3.0.0",

View File

@@ -6,6 +6,7 @@ import asyncMap from '@xen-orchestra/async-map'
import createLogger from '@xen-orchestra/log'
import defer from 'golike-defer'
import limitConcurrency from 'limit-concurrency-decorator'
import safeTimeout from 'strict-timeout/safe'
import { type Pattern, createPredicate } from 'value-matcher'
import { type Readable, PassThrough } from 'stream'
import { AssertionError } from 'assert'
@@ -639,7 +640,7 @@ export default class BackupNg {
if (timeout !== 0) {
const source = CancelToken.source([cancelToken])
cancelToken = source.token
setTimeout(source.cancel, timeout)
safeTimeout(source.cancel, timeout)
}
let handleVm = async vm => {

View File

@@ -13144,6 +13144,11 @@ stream-to-pull-stream@^1.7.1:
looper "^3.0.0"
pull-stream "^3.2.3"
strict-timeout@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/strict-timeout/-/strict-timeout-1.0.0.tgz#f77c6dedec379a3b9d8d922bee0398ae5b1415ee"
integrity sha512-CW2XC7sLJ2Qvc69sv9jFal48c6+hupGzFF04nJOsThriJcPfHO9iAtVnr6jvHWyvDj1XlOOFJkljZneex97STg==
strict-uri-encode@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713"