[
https://issues.apache.org/jira/browse/TS-1007?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13145164#comment-13145164
]
Nick Kew commented on TS-1007:
------------------------------
Two further thoughts from digging in the code:
The immediate culprit seems to be this one:
#5 0x0818c31d in HttpClientSession::do_api_callout (this=0x9624030,
id=TS_HTTP_SSN_CLOSE_HOOK) at HttpClientSession.cc:172
Inserting TXN_CLOSE in front of that could help in principle, but the txn
doesn't appear to be available at this point, and moving up a level is more
complex.
Second thought: what would be the effect of setting the half_close flag before
entering do_api_callout? That selects an altogether different and presumably
proven code path, but to what effect?
> SSN Close called before TXN Close
> ---------------------------------
>
> Key: TS-1007
> URL: https://issues.apache.org/jira/browse/TS-1007
> Project: Traffic Server
> Issue Type: Bug
> Components: TS API
> Affects Versions: 3.0.1
> Reporter: Nick Kew
> Priority: Critical
>
> Where a plugin implements both SSN_CLOSE_HOOK and TXN_CLOSE_HOOK, the
> SSN_CLOSE_HOOK is called first of the two. This messes up normal cleanups!
> Details:
> Register a SSN_START event globally
> In the SSN START, add a TXN_START and a SSN_CLOSE
> In the TXN START, add a TXN_CLOSE
> Stepping through, I see the order of events actually called, for the simple
> case of a one-off HTTP request with no keepalive:
> SSN_START
> TXN_START
> SSN_END
> TXN_END
> Whoops, SSN_END cleaned up the SSN context, leaving dangling pointers in the
> TXN!
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira