summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
5e6222a)
Type: improvement
Can be used to force app to close a connection on which it still waits
for data.
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I7c3a8245cbbc23728e4408feb63a659a11f718ed
+ if (msg->type == SESSION_CLEANUP_TRANSPORT)
+ {
+ /* Transport was cleaned up before we confirmed close. Probably the
+ * app is still waiting for some data that cannot be delivered.
+ * Confirm close to make sure everything is cleaned up */
+ if (session->session_state == STATE_VPP_CLOSING)
+ vcl_session_cleanup (wrk, session, vcl_session_handle (session),
+ 1 /* do_disconnect */ );
+ return;
+ }
+
vcl_session_table_del_vpp_handle (wrk, msg->handle);
/* Should not happen. App did not close the connection so don't free it. */
if (session->session_state != STATE_CLOSED)
vcl_session_table_del_vpp_handle (wrk, msg->handle);
/* Should not happen. App did not close the connection so don't free it. */
if (session->session_state != STATE_CLOSED)
typedef struct session_cleanup_msg_
{
session_handle_t handle;
typedef struct session_cleanup_msg_
{
session_handle_t handle;
} __clib_packed session_cleanup_msg_t;
typedef struct app_session_event_
} __clib_packed session_cleanup_msg_t;
typedef struct app_session_event_
session_event_t *evt;
app_worker_t *app_wrk;
session_event_t *evt;
app_worker_t *app_wrk;
- /* Only propagate session cleanup notification */
- if (ntf == SESSION_CLEANUP_TRANSPORT)
+ /* Propagate transport cleanup notifications only if app didn't close */
+ if (ntf == SESSION_CLEANUP_TRANSPORT
+ && s->session_state != SESSION_STATE_TRANSPORT_DELETED)
return;
app_wrk = app_worker_get_if_valid (s->app_wrk_index);
return;
app_wrk = app_worker_get_if_valid (s->app_wrk_index);
evt->event_type = SESSION_CTRL_EVT_CLEANUP;
mp = (session_cleanup_msg_t *) evt->data;
mp->handle = session_handle (s);
evt->event_type = SESSION_CTRL_EVT_CLEANUP;
mp = (session_cleanup_msg_t *) evt->data;
mp->handle = session_handle (s);
svm_msg_q_add_and_unlock (app_mq, msg);
}
svm_msg_q_add_and_unlock (app_mq, msg);
}
s = format (s, "%U", tp_vft->format_connection, conn_index, thread_index,
verbose);
tc = tp_vft->get_connection (conn_index, thread_index);
s = format (s, "%U", tp_vft->format_connection, conn_index, thread_index,
verbose);
tc = tp_vft->get_connection (conn_index, thread_index);
- if (tc && transport_connection_is_tx_paced (tc) && verbose > 1)
{
indent = format_get_indent (s) + 1;
{
indent = format_get_indent (s) + 1;
- s = format (s, "%Upacer: %U\n", format_white_space, indent,
- format_transport_pacer, &tc->pacer, tc->thread_index);
+ if (transport_connection_is_tx_paced (tc))
+ s = format (s, "%Upacer: %U\n", format_white_space, indent,
+ format_transport_pacer, &tc->pacer, tc->thread_index);
s = format (s, "%Utransport: flags 0x%x\n", format_white_space, indent,
tc->flags);
}
s = format (s, "%Utransport: flags 0x%x\n", format_white_space, indent,
tc->flags);
}
tls_ctx_t *ctx;
if (ntf == SESSION_CLEANUP_TRANSPORT)
tls_ctx_t *ctx;
if (ntf == SESSION_CLEANUP_TRANSPORT)
+ {
+ /* Allow cleanup of tcp session */
+ if (s->session_state == SESSION_STATE_TRANSPORT_DELETED)
+ session_close (s);
+ return;
+ }
ctx = tls_ctx_get (s->opaque);
if (!ctx->no_app_session)
ctx = tls_ctx_get (s->opaque);
if (!ctx->no_app_session)