Skip to content

Commit

Permalink
[debug] provide more unique event names for waitqueues
Browse files Browse the repository at this point in the history
Change-Id: Iddf9e10b3902fbfe4fa7e97b7a172018d0d70b54
  • Loading branch information
stbuehler committed Aug 9, 2015
1 parent 535f6b4 commit f527a16
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion include/lighttpd/waitqueue.h
Expand Up @@ -34,7 +34,7 @@ struct liWaitQueue {
*/

/* initializes a waitqueue by creating the timer and initializing the queue. precision is sub-seconds */
LI_API void li_waitqueue_init(liWaitQueue *queue, liEventLoop *loop, liWaitQueueCB callback, gdouble delay, gpointer data);
LI_API void li_waitqueue_init(liWaitQueue *queue, liEventLoop *loop, const char *waitqueue_name, liWaitQueueCB callback, gdouble delay, gpointer data);

/* stops the waitqueue. to restart it, simply call li_waitqueue_update */
LI_API void li_waitqueue_stop(liWaitQueue *queue);
Expand Down
4 changes: 2 additions & 2 deletions src/common/waitqueue.c
Expand Up @@ -8,8 +8,8 @@ static void wq_cb(liEventBase *watcher, int events) {
queue->callback(queue, queue->data);
}

void li_waitqueue_init(liWaitQueue *queue, liEventLoop *loop, liWaitQueueCB callback, gdouble delay, gpointer data) {
li_event_timer_init(loop, "waitqueue", &queue->timer, wq_cb);
void li_waitqueue_init(liWaitQueue *queue, liEventLoop *loop, const char *waitqueue_name, liWaitQueueCB callback, gdouble delay, gpointer data) {
li_event_timer_init(loop, waitqueue_name, &queue->timer, wq_cb);

queue->head = queue->tail = NULL;
queue->delay = delay;
Expand Down
8 changes: 4 additions & 4 deletions src/main/backends.c
Expand Up @@ -775,12 +775,12 @@ static gpointer backend_pool_worker_init(liWorker *wrk, gpointer fdata) {

if (wpool->initialized) return NULL;

li_event_async_init(&wrk->loop, "backend pool", &wpool->wakeup, backend_pool_worker_run);
li_event_async_init(&wrk->loop, "backend manager", &wpool->wakeup, backend_pool_worker_run);
if (idle_timeout < 1) idle_timeout = 5;
li_waitqueue_init(&wpool->idle_queue, &wrk->loop, backend_pool_worker_idle_timeout, idle_timeout, wpool);
li_waitqueue_init(&wpool->connect_queue, &wrk->loop, backend_pool_worker_connect_timeout, pool->public.config->connect_timeout, wpool);
li_waitqueue_init(&wpool->idle_queue, &wrk->loop, "backend idle queue", backend_pool_worker_idle_timeout, idle_timeout, wpool);
li_waitqueue_init(&wpool->connect_queue, &wrk->loop, "backend connect queue", backend_pool_worker_connect_timeout, pool->public.config->connect_timeout, wpool);

li_event_timer_init(&wrk->loop, "backend pool", &wpool->wait_queue_timer, backend_pool_wait_queue_timeout);
li_event_timer_init(&wrk->loop, "backend wait timeout", &wpool->wait_queue_timer, backend_pool_wait_queue_timeout);
li_event_set_keep_loop_alive(&wpool->wait_queue_timer, FALSE);

wpool->initialized = TRUE;
Expand Down
2 changes: 1 addition & 1 deletion src/main/log.c
Expand Up @@ -110,7 +110,7 @@ void li_log_init(liServer *srv) {
li_event_loop_init(&srv->logs.loop, ev_loop_new(EVFLAG_AUTO));
li_event_async_init(&srv->logs.loop, "log", &srv->logs.watcher, log_watcher_cb);
srv->logs.targets = li_radixtree_new();
li_waitqueue_init(&srv->logs.close_queue, &srv->logs.loop, log_close_cb, LOG_DEFAULT_TTL, srv);
li_waitqueue_init(&srv->logs.close_queue, &srv->logs.loop, "log close queue", log_close_cb, LOG_DEFAULT_TTL, srv);
srv->logs.timestamp.format = g_string_new_len(CONST_STR_LEN(LOG_DEFAULT_TS_FORMAT));
srv->logs.timestamp.cached = g_string_sized_new(255);
srv->logs.timestamp.last_ts = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/main/stat_cache.c
Expand Up @@ -25,7 +25,7 @@ liStatCache* li_stat_cache_new(liWorker *wrk, gdouble ttl) {
sc->entries = g_hash_table_new_full((GHashFunc)g_string_hash, (GEqualFunc)g_string_equal, NULL, NULL);
sc->dirlists = g_hash_table_new_full((GHashFunc)g_string_hash, (GEqualFunc)g_string_equal, NULL, NULL);

li_waitqueue_init(&sc->delete_queue, &wrk->loop, stat_cache_delete_cb, ttl, sc);
li_waitqueue_init(&sc->delete_queue, &wrk->loop, "stat cache delete queue", stat_cache_delete_cb, ttl, sc);

return sc;
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/worker.c
Expand Up @@ -324,10 +324,10 @@ liWorker* li_worker_new(liServer *srv, struct ev_loop *loop) {
wrk->collect_queue = g_async_queue_new();

/* io timeout timer */
li_waitqueue_init(&wrk->io_timeout_queue, &wrk->loop, worker_io_timeout_cb, srv->io_timeout, wrk);
li_waitqueue_init(&wrk->io_timeout_queue, &wrk->loop, "io timeout queue", worker_io_timeout_cb, srv->io_timeout, wrk);

/* throttling */
li_waitqueue_init(&wrk->throttle_queue, &wrk->loop, li_throttle_waitqueue_cb, ((gdouble)LI_THROTTLE_GRANULARITY) / 1000, wrk);
li_waitqueue_init(&wrk->throttle_queue, &wrk->loop, "throttle queue", li_throttle_waitqueue_cb, ((gdouble)LI_THROTTLE_GRANULARITY) / 1000, wrk);

wrk->tasklets = li_tasklet_pool_new(&wrk->loop, srv->tasklet_pool_threads);

Expand Down
2 changes: 1 addition & 1 deletion src/modules/mod_limit.c
Expand Up @@ -417,7 +417,7 @@ static void mod_limit_prepare_worker(liServer *srv, liPlugin *p, liWorker *wrk)
mld = p->data;
}

li_waitqueue_init(&(mld->timeout_queues[wrk->ndx]), &wrk->loop, mod_limit_timeout_callback, 1.0, NULL);
li_waitqueue_init(&(mld->timeout_queues[wrk->ndx]), &wrk->loop, "mod_limit timeout queue", mod_limit_timeout_callback, 1.0, NULL);
}

static void plugin_limit_free(liServer *srv, liPlugin *p) {
Expand Down
2 changes: 1 addition & 1 deletion src/modules/mod_progress.c
Expand Up @@ -454,7 +454,7 @@ static void progress_prepare(liServer *srv, liPlugin *p) {
pd->worker_data[i].pd = pd;
pd->worker_data[i].wrk_ndx = i;
pd->worker_data[i].hash_table = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, progress_hashtable_free_callback);
li_waitqueue_init(&(pd->worker_data[i].timeout_queue), &wrk->loop, progress_timeout_callback, pd->ttl, &pd->worker_data[i]);
li_waitqueue_init(&(pd->worker_data[i].timeout_queue), &wrk->loop, "mod_progress cleanup queue", progress_timeout_callback, pd->ttl, &pd->worker_data[i]);
}
}

Expand Down

0 comments on commit f527a16

Please sign in to comment.