Squid-2.2.STABLE4: Event-queue starvation on high load Under high load events in the event queue could experience starvation. This patch fixes a obvious problem where cancelled events would make the queue stall, and boosts the priority of event handling somewhat. It also adds more detail to the event queue output in cachemgr. Index: squid/src/event.c diff -u squid/src/event.c:1.1.1.12 squid/src/event.c:1.1.1.12.2.1 --- squid/src/event.c:1.1.1.12 Tue Jul 13 00:09:27 1999 +++ squid/src/event.c Sun Aug 1 17:24:53 1999 @@ -125,7 +125,7 @@ break; if (event->id == run_id) /* was added during this run */ break; - if (weight) + if (weight > 3) break; func = event->func; arg = event->arg; @@ -137,7 +137,7 @@ cbdataUnlock(arg); if (!valid) { safe_free(event); - return; + continue; } } weight += event->weight; @@ -167,12 +167,14 @@ eventDump(StoreEntry * sentry) { struct ev_entry *e = tasks; - storeAppendPrintf(sentry, "%s\t%s\n", + storeAppendPrintf(sentry, "%s\t%s\t%s\t%s\n", "Operation", - "Next Execution"); + "Next Execution", + "Weight", + "Id"); while (e != NULL) { - storeAppendPrintf(sentry, "%s\t%f seconds\n", - e->name, e->when - current_dtime); + storeAppendPrintf(sentry, "%s\t%f seconds\t%d\t%d\n", + e->name, e->when - current_dtime, e->weight, e->id); e = e->next; } }