aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-12-18 22:44:27 -0800
committerFlorin Coras <fcoras@cisco.com>2018-12-19 02:17:34 -0800
commite96bf63bd0dc483179dc595b65ebd8bf2b310b8b (patch)
treede98f93bf4ac9aab85782b2e3f34d02583d35646 /src/vnet/session
parente2ea193171f4701aa575379da0e1bac16a85aa33 (diff)
tcp/session: notify transport of close when tx fifo is not empty
Disconnect transport even if tx fifo is not empty and have transport deal with the problem. In case of tcp, add timer to fin_wait_1. If it expires and we're still in established state, cleanup but only after waiting for session tx events to cleanup. Change-Id: I45759a3c43dd096bb2c03daf5372416c30678d62 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session')
-rw-r--r--src/vnet/session/session_node.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/vnet/session/session_node.c b/src/vnet/session/session_node.c
index 58d31ccb87c..e8ed1cf9b95 100644
--- a/src/vnet/session/session_node.c
+++ b/src/vnet/session/session_node.c
@@ -874,21 +874,19 @@ 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;
}