Skip to content

Commit f10d930

Browse files
committed
fix: always return quarantineUntil field in
worker manager X queue methods
1 parent 9b95a1a commit f10d930

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

changelog/WFqYtmKPQfuMVMkhEKU9ug.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
audience: general
2+
level: patch
3+
---
4+
This patch returns up the `quarantineUntil` field in the `workerManager.getWorker` and `workerManager.listWorkers` methods. This issue was first noticed in v44.15.0.

services/worker-manager/src/api.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -905,13 +905,11 @@ builder.declare({
905905
state: worker.state || 'standalone',
906906
capacity: worker.capacity || 0,
907907
providerId: worker.providerId || 'none',
908+
quarantineUntil: worker.quarantineUntil?.toJSON(),
908909
};
909910
if (worker.recentTasks.length > 0) {
910911
entry.latestTask = worker.recentTasks[worker.recentTasks.length - 1];
911912
}
912-
if (worker.quarantineUntil?.getTime() > now.getTime()) {
913-
entry.quarantineUntil = worker.quarantineUntil.toJSON();
914-
}
915913
return entry;
916914
}),
917915
};

services/worker-manager/src/data.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,7 @@ class Worker {
432432
firstClaim: this.firstClaim?.toJSON(),
433433
recentTasks: _.cloneDeep(this.recentTasks),
434434
lastDateActive: this.lastDateActive?.toJSON(),
435+
quarantineUntil: this.quarantineUntil?.toJSON(),
435436
};
436437

437438
// Remove properties that should not be in this response schema.
@@ -441,6 +442,7 @@ class Worker {
441442
delete worker.firstClaim;
442443
delete worker.recentTasks;
443444
delete worker.lastDateActive;
445+
delete worker.quarantineUntil;
444446
}
445447

446448
// Remove properties that should not be in this response schema.

services/worker-manager/test/api_test.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -683,11 +683,7 @@ helper.secrets.mockSuite(testing.suiteName(), [], function(mock, skipping) {
683683
workerGroup: input.workerGroup,
684684
workerId: input.workerId,
685685
});
686-
const expected = worker.serializable();
687-
// remove properties that come from queue_workers table
688-
delete expected.firstClaim;
689-
delete expected.recentTasks;
690-
delete expected.lastDateActive;
686+
const expected = worker.serializable({ removeQueueData: true });
691687

692688
assert(!('secret' in data));
693689
assert.deepStrictEqual(data, expected);

0 commit comments

Comments
 (0)