fix(xo-server/worker): forget remote after use (#4079)

Fixes xoa-support#1378
Fixes xoa-support#1384
Fixes xoa-support#1399
This commit is contained in:
Julien Fontanet 2019-03-27 10:52:42 +01:00 committed by GitHub
parent 851bcf9816
commit 0938804947
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

View File

@ -2,7 +2,7 @@
### Enhancements
- [Remote] Benchmarks (read and write rate speed) added when remote is tested [#3991](https://github.com/vatesfr/xen-orchestra/issues/3991) (PR [#4015](https://github.com/vatesfr/xen-orchestra/pull/4015))
- [Remotes] Benchmarks (read and write rate speed) added when remote is tested [#3991](https://github.com/vatesfr/xen-orchestra/issues/3991) (PR [#4015](https://github.com/vatesfr/xen-orchestra/pull/4015))
- [Cloud Config] Support both NoCloud and Config Drive 2 datasources for maximum compatibility (PR [#4053](https://github.com/vatesfr/xen-orchestra/pull/4053))
- [Advanced] Configurable cookie validity (PR [#4059](https://github.com/vatesfr/xen-orchestra/pull/4059))
- [Plugins] Display number of installed plugins [#4008](https://github.com/vatesfr/xen-orchestra/issues/4008) (PR [#4050](https://github.com/vatesfr/xen-orchestra/pull/4050))
@ -10,6 +10,7 @@
### Bug fixes
- [Home] Always sort the items by their names as a secondary sort criteria [#3983](https://github.com/vatesfr/xen-orchestra/issues/3983) (PR [#4047](https://github.com/vatesfr/xen-orchestra/pull/4047))
- [Remotes] Fixes `spawn mount EMFILE` error during backup
- Properly redirect to sign in page instead of being stuck in a refresh loop
### Released packages

View File

@ -1,5 +1,6 @@
// @flow
import defer from 'golike-defer'
import { type Remote, getHandler } from '@xen-orchestra/fs'
import { mergeVhd as mergeVhd_ } from 'vhd-lib'
@ -12,7 +13,8 @@ global.Promise = require('bluebird')
// $FlowFixMe
const config: Object = JSON.parse(process.env.XO_CONFIG)
export async function mergeVhd(
export const mergeVhd = defer(async function(
$defer: any,
parentRemote: Remote,
parentPath: string,
childRemote: Remote,
@ -21,9 +23,11 @@ export async function mergeVhd(
const parentHandler = getHandler(parentRemote, config.remoteOptions)
const childHandler = getHandler(childRemote, config.remoteOptions)
// DO NOT forget the handlers as it they are still in use in the main process
await parentHandler.sync()
$defer.call(parentHandler, 'forget')
await childHandler.sync()
$defer.call(childHandler, 'forget')
return mergeVhd_(parentHandler, parentPath, childHandler, childPath)
}
})