Warning("Stopping %s %s in %d ms.\n", proxy_cap_str(p->cap), p->id, p->grace);
send_log(p, LOG_WARNING, "Stopping %s %s in %d ms.\n", proxy_cap_str(p->cap), p->id, p->grace);
p->stop_time = tick_add(now_ms, p->grace);
- }
- if (p->table.size && p->table.sync_task)
- task_wakeup(p->table.sync_task, TASK_WOKEN_MSG);
- /* wake every proxy task up so that they can handle the stopping */
- if (p->task)
- task_wakeup(p->task, TASK_WOKEN_MSG);
+ /* Note: do not wake up stopped proxies' task nor their tables'
+ * tasks as these ones might point to already released entries.
+ */
+ if (p->table.size && p->table.sync_task)
+ task_wakeup(p->table.sync_task, TASK_WOKEN_MSG);
+
+ if (p->task)
+ task_wakeup(p->task, TASK_WOKEN_MSG);
+ }
p = p->next;
}