[
https://issues.apache.org/jira/browse/TS-2883?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14029544#comment-14029544
]
Sudheer Vinukonda commented on TS-2883:
---------------------------------------
Added further debug logs, and noticed that the below error log was printed
right at the same time as the core dump. Looking into the code, it looks like,
if there's an error in spdy_process_fetch(), req->clear is called which calls
TSFetchDestroy(), but, the client session is not released, since, it's
returning 0 and the calling function
SpdyClientSession::state_session_readwrite() expects a non-zero error code to
be returned inorder to clean up client session. Not entirely clear, if not
clearing the client session in this error case might mess up something in the
FetchSMAllocator. Adding "return -1", to clear out the client session. Will
test this to see if it helps.
{code}
static int
spdy_process_fetch(TSEvent event, SpdyClientSession *sm, void *edata)
{
//..
if (ret) {
spdy_prepare_status_response(sm, req->stream_id, STATUS_500);
Error("spdy_process_fetch sending STATUS_500, ret %d for sm_id %u,
stream_id %u, req time %lld, url %s", ret, sm->sm_id, req->stream_id,
req->start_time, req->url.c_str());
sm->req_map.erase(req->stream_id);
req->clear();
spdyRequestAllocator.free(req);
}
return 0;
}
int
SpdyClientSession::state_session_readwrite(int event, void * edata)
{
//...
} else {
from_fetch = true;
ret = spdy_process_fetch((TSEvent)event, this, edata);
}
Debug("spdy-event", "++++SpdyClientSession[%" PRIu64 "], EVENT:%d, ret:%d",
this->sm_id, event, ret);
out:
if (ret) {
this->clear();
spdyClientSessionAllocator.free(this);
} else if (!from_fetch) {
this->vc->set_inactivity_timeout(HRTIME_SECONDS(spdy_no_activity_timeout_in));
}
return EVENT_CONT;
}
{code}
> core dump in TSFetchCreate()
> ----------------------------
>
> Key: TS-2883
> URL: https://issues.apache.org/jira/browse/TS-2883
> Project: Traffic Server
> Issue Type: Bug
> Components: Core, SPDY
> Reporter: Sudheer Vinukonda
>
> {code}
> (gdb) bt
> #0 ink_freelist_new (f=0x2923050) at ink_queue.cc:202
> #1 0x00000000004c0cd2 in alloc (contp=0x2b86821e2120,
> method=TS_FETCH_METHOD_POST,
> url=0x2b865d64f228
> "https://aa-mg5.mail.yahoo.com/ws/mail/v2.0/jsonrpc?appid=YahooMailNeo&m=BatchExecute&wssid=nG7kmTWsJCD&action=compose_0_savedraft&actionCount=88&debugmid=2_0_0_3_126623_AMNwimIAAC82U5ZXLwAAAFWGrR8&deb"...,
> version=0x2b865da5ace8 "HTTP/1.1", client_addr=<value optimized out>,
> flags=<value optimized out>) at ../lib/ts/Allocator.h:117
> #2 TSFetchCreate (contp=0x2b86821e2120, method=TS_FETCH_METHOD_POST,
> url=0x2b865d64f228
> "https://aa-mg5.mail.yahoo.com/ws/mail/v2.0/jsonrpc?appid=YahooMailNeo&m=BatchExecute&wssid=nG7kmTWsJCD&action=compose_0_savedraft&actionCount=88&debugmid=2_0_0_3_126623_AMNwimIAAC82U5ZXLwAAAFWGrR8&deb"...,
> version=0x2b865da5ace8 "HTTP/1.1", client_addr=<value optimized out>,
> flags=<value optimized out>) at InkAPI.cc:7289
> #3 0x00000000005f117e in spdy_fetcher_launch (req=0x2b871c2fa900,
> method=TS_FETCH_METHOD_POST) at SpdyCallbacks.cc:187
> #4 0x00000000005f1faa in spdy_process_syn_stream_frame (session=<value
> optimized out>, type=<value optimized out>, frame=<value optimized out>,
> user_data=0x2b86821e2120)
> at SpdyCallbacks.cc:295
> #5 spdy_on_ctrl_recv_callback (session=<value optimized out>, type=<value
> optimized out>, frame=<value optimized out>, user_data=0x2b86821e2120) at
> SpdyCallbacks.cc:335
> #6 0x0000000000738050 in spdylay_session_on_syn_stream_received
> (session=0x2b865defce10, frame=0x2b858f987a20) at spdylay_session.c:1782
> #7 0x0000000000738d57 in spdylay_session_process_ctrl_frame
> (session=0x2b865defce10, in=0x2b858f987a90 "\200\003", inlen=<value optimized
> out>) at spdylay_session.c:2246
> #8 spdylay_session_mem_recv (session=0x2b865defce10, in=0x2b858f987a90
> "\200\003", inlen=<value optimized out>) at spdylay_session.c:2805
> #9 0x0000000000738f89 in spdylay_session_recv (session=0x2b865defce10) at
> spdylay_session.c:2828
> #10 0x00000000005ef17b in spdy_process_read (this=0x2b86821e2120, event=100,
> edata=<value optimized out>) at SpdyClientSession.cc:279
> #11 SpdyClientSession::state_session_readwrite (this=0x2b86821e2120,
> event=100, edata=<value optimized out>) at SpdyClientSession.cc:236
> #12 0x000000000070dbd7 in handleEvent (this=0x2b86fc1d2cf0, event=<value
> optimized out>) at ../../iocore/eventsystem/I_Continuation.h:146
> #13 read_signal_and_update (this=0x2b86fc1d2cf0, event=<value optimized out>)
> at UnixNetVConnection.cc:138
> #14 UnixNetVConnection::readSignalAndUpdate (this=0x2b86fc1d2cf0,
> event=<value optimized out>) at UnixNetVConnection.cc:914
> #15 0x00000000006fe66f in SSLNetVConnection::net_read_io
> (this=0x2b86fc1d2cf0, nh=0x2b858d46bbf0, lthread=0x2b858d468010) at
> SSLNetVConnection.cc:294
> #16 0x0000000000705a72 in NetHandler::mainNetEvent (this=0x2b858d46bbf0,
> event=<value optimized out>, e=<value optimized out>) at UnixNet.cc:399
> #17 0x00000000007323ef in handleEvent (this=0x2b858d468010, e=0x2a7db30,
> calling_code=5) at I_Continuation.h:146
> #18 EThread::process_event (this=0x2b858d468010, e=0x2a7db30, calling_code=5)
> at UnixEThread.cc:145
> #19 0x0000000000732d93 in EThread::execute (this=0x2b858d468010) at
> UnixEThread.cc:269
> #20 0x000000000073179a in spawn_thread_internal (a=0x2e404e0) at Thread.cc:88
> #21 0x00002b835bf28851 in start_thread () from /lib64/libpthread.so.0
> #22 0x000000361a0e894d in clone () from /lib64/libc.so.6
> {code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)