fix(xen-api/_watchEvents): dont fetch events while fetching tasks
When our tasks cache is desynchronized we re-fetch all tasks. We must wait before fetching the next events to have fetch the tasks otherwise we risk a race condition.
This commit is contained in:
@@ -1038,7 +1038,7 @@ export class Xapi extends EventEmitter {
|
||||
|
||||
// detect and fix disappearing tasks (e.g. when toolstack restarts)
|
||||
if (result.valid_ref_counts.task !== this._nTasks) {
|
||||
ignoreErrors.call(
|
||||
await ignoreErrors.call(
|
||||
this._sessionCall('task.get_all_records').then(tasks => {
|
||||
const toRemove = new Set()
|
||||
forOwn(this.objects.all, object => {
|
||||
|
||||
Reference in New Issue
Block a user