Browse Source

[debug] provide more unique event names for waitqueues

Change-Id: Iddf9e10b3902fbfe4fa7e97b7a172018d0d70b54
master
Stefan Bühler 6 years ago
parent
commit
f527a16138
  1. 2
      include/lighttpd/waitqueue.h
  2. 4
      src/common/waitqueue.c
  3. 8
      src/main/backends.c
  4. 2
      src/main/log.c
  5. 2
      src/main/stat_cache.c
  6. 4
      src/main/worker.c
  7. 2
      src/modules/mod_limit.c
  8. 2
      src/modules/mod_progress.c

2
include/lighttpd/waitqueue.h

@ -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);

4
src/common/waitqueue.c

@ -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;

8
src/main/backends.c

@ -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;

2
src/main/log.c

@ -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;

2
src/main/stat_cache.c

@ -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;
}

4
src/main/worker.c

@ -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);

2
src/modules/mod_limit.c

@ -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) {

2
src/modules/mod_progress.c

@ -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]);
}
}

Loading…
Cancel
Save