X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fsession%2Fsession_node.c;h=4323ed83cf8ce10a097db855cdaae123c3586613;hb=5a2ec8fc41d14ffc5275ab88761c1fb7e0420a33;hp=eb9026c6457ec1fc85db00fc9e56a409f7a66e0e;hpb=3c7d4f9e1f54ec6627795b64525f182e2cda7490;p=vpp.git diff --git a/src/vnet/session/session_node.c b/src/vnet/session/session_node.c index eb9026c6457..4323ed83cf8 100644 --- a/src/vnet/session/session_node.c +++ b/src/vnet/session/session_node.c @@ -64,11 +64,9 @@ session_mq_accepted_reply_handler (void *data) else { s = session_get_from_handle_if_valid (mp->handle); - if (!s) - { - clib_warning ("session 0x%llx doesn't exist", mp->handle); - return; - } + /* Closed while waiting for app to reply */ + if (!s || s->session_state > SESSION_STATE_READY) + return; app_wrk = app_worker_get (s->app_wrk_index); if (app_wrk->app_index != mp->context) { @@ -448,7 +446,7 @@ session_tx_not_ready (stream_session_t * s, u8 peek_data) * session is not ready or closed */ if (s->session_state < SESSION_STATE_READY) return 1; - if (s->session_state == SESSION_STATE_CLOSED) + if (s->session_state >= SESSION_STATE_TRANSPORT_CLOSED) return 2; } return 0; @@ -876,26 +874,24 @@ session_queue_node_fn (vlib_main_t * vm, vlib_node_runtime_t * node, } break; case FIFO_EVENT_DISCONNECT: - /* Make sure stream disconnects run after the pending list is - * drained */ s = session_get_from_handle_if_valid (e->session_handle); if (PREDICT_FALSE (!s)) break; - if (!e->postponed) - { - e->postponed = 1; - vec_add1 (wrk->pending_disconnects, *e); - continue; - } - /* If tx queue is still not empty, wait */ - if (svm_fifo_max_dequeue (s->server_tx_fifo)) + /* Make sure session disconnects run after the pending list is + * drained, i.e., postpone if the first time. If not the first + * and the tx queue is still not empty, try to wait for some + * dispatch cycles */ + if (!e->postponed + || (e->postponed < 200 + && svm_fifo_max_dequeue (s->server_tx_fifo))) { + e->postponed += 1; vec_add1 (wrk->pending_disconnects, *e); continue; } - stream_session_disconnect_transport (s); + session_transport_close (s); break; case FIFO_EVENT_BUILTIN_RX: s = session_event_get_session (e, thread_index);