graphai 2.0.17 → 2.0.18
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/lib/task_manager.js +9 -8
- package/package.json +1 -1
package/lib/task_manager.js
CHANGED
|
@@ -167,14 +167,15 @@ class TaskManager {
|
|
|
167
167
|
}
|
|
168
168
|
perParent.set(parentGraphId, (perParent.get(parentGraphId) ?? 0) + 1);
|
|
169
169
|
}
|
|
170
|
-
//
|
|
171
|
-
//
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
170
|
+
// IMPORTANT: do NOT drain the queue here. The concurrency++ above reserves a
|
|
171
|
+
// slot so the nested graph's own children have headroom to run (deadlock
|
|
172
|
+
// avoidance, which mapAgent asserts via `concurrency > running`). At this
|
|
173
|
+
// point the nested children are not queued yet -- the nested graph is built
|
|
174
|
+
// and run *after* prepareForNesting returns -- so draining now can only
|
|
175
|
+
// dispatch unrelated already-queued sibling tasks into the reserved slot,
|
|
176
|
+
// immediately consuming the headroom and tripping mapAgent's guard. The
|
|
177
|
+
// nested children, and any newly-eligible queued tasks, are dispatched when
|
|
178
|
+
// they call addTask() or when a slot frees up in onComplete().
|
|
178
179
|
}
|
|
179
180
|
restoreAfterNesting(label, parentGraphId) {
|
|
180
181
|
this.concurrency--;
|