diff options
author | 2024-10-04 14:35:26 +0200 | |
---|---|---|
committer | 2024-10-14 17:03:12 +0000 | |
commit | 5c8ddd54c12e05db233173e890152ecda4c27888 (patch) | |
tree | 1545bdccc62c286043102595ec44ea84db784e6a /src/plugins/http/http_timer.c | |
parent | b6ac2d7a7a4407f8a3e7e9d68f850d2f76d2dc1a (diff) |
http: timer pool assert crash fix
Two iterations over expiret timers:
1) ivalidate timer handle and mark the connection as having a pending
timer
2) send RPCs to workers
Type: fix
Change-Id: Iadc031c4e6d6f7bbd851d0421e6e0ea2d2b5e70f
Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'src/plugins/http/http_timer.c')
-rw-r--r-- | src/plugins/http/http_timer.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/plugins/http/http_timer.c b/src/plugins/http/http_timer.c index 5ee8efc8551..580f31657a9 100644 --- a/src/plugins/http/http_timer.c +++ b/src/plugins/http/http_timer.c @@ -29,7 +29,15 @@ http_timer_process_expired_cb (u32 *expired_timers) { /* Get session handle. The first bit is the timer id */ hs_handle = expired_timers[i] & 0x7FFFFFFF; - session_send_rpc_evt_to_thread (hs_handle >> 24, twc->cb_fn, + twc->invalidate_cb (hs_handle); + } + for (i = 0; i < vec_len (expired_timers); i++) + { + /* Get session handle. The first bit is the timer id */ + hs_handle = expired_timers[i] & 0x7FFFFFFF; + HTTP_DBG (1, "rpc to hc [%u]%x", hs_handle >> 24, + hs_handle & 0x00FFFFFF); + session_send_rpc_evt_to_thread (hs_handle >> 24, twc->rpc_cb, uword_to_pointer (hs_handle, void *)); } } @@ -66,7 +74,8 @@ VLIB_REGISTER_NODE (http_timer_process_node) = { }; void -http_timers_init (vlib_main_t *vm, http_conn_timeout_fn *cb_fn) +http_timers_init (vlib_main_t *vm, http_conn_timeout_fn *rpc_cb, + http_conn_invalidate_timer_fn *invalidate_cb) { http_tw_ctx_t *twc = &http_tw_ctx; vlib_node_t *n; @@ -76,7 +85,8 @@ http_timers_init (vlib_main_t *vm, http_conn_timeout_fn *cb_fn) tw_timer_wheel_init_2t_1w_2048sl (&twc->tw, http_timer_process_expired_cb, 1.0 /* timer interval */, ~0); clib_spinlock_init (&twc->tw_lock); - twc->cb_fn = cb_fn; + twc->rpc_cb = rpc_cb; + twc->invalidate_cb = invalidate_cb; vlib_node_set_state (vm, http_timer_process_node.index, VLIB_NODE_STATE_POLLING); |