Skip to content

Commit 3268ac0

Browse files
committed
fix itable iteration bug in vine_worker
1 parent 660456c commit 3268ac0

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

taskvine/src/worker/vine_worker.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,14 +1104,15 @@ then we need to abort to clean things up.
11041104

11051105
static void kill_all_tasks()
11061106
{
1107-
struct vine_process *p;
1108-
uint64_t task_id;
1107+
uint64_t *task_ids = itable_keys_array(procs_table);
1108+
int total_tasks = itable_size(procs_table);
11091109

1110-
ITABLE_ITERATE(procs_table, task_id, p)
1111-
{
1112-
do_kill(task_id);
1110+
for (int i = 0; i < total_tasks; i++) {
1111+
do_kill(task_ids[i]);
11131112
}
11141113

1114+
itable_free_keys_array(task_ids);
1115+
11151116
assert(itable_size(procs_table) == 0);
11161117
assert(itable_size(procs_running) == 0);
11171118
assert(itable_size(procs_complete) == 0);

0 commit comments

Comments
 (0)