Fixed memory leaking introduced by 4873#5044
Conversation
|
link to #5042 |
|
As the state machine implementer,
As the underlying processor implementer,
Setting the The comments in I_VConnection.h for VConnection::do_io_close: |
|
I think I agree with @oknet - the call to |
|
We call transcation_done from the HttpSM::kill_this() to allow for the TXN_CLOSE hook to be called at the proper end of the transaction. As I recall, trying to trigger the TXN_CLOSE hooks from the ProxyTransaction::do_io_close() was problematic. There were cases when the transaction wasn't quite done. The ua_txn->do_io_close() will shutdown the VConnection associated with the user agent and null out the reference, so there is no dangling VConnection. However, we still need the ProxyTransaction object (ua_txn), so we can signal TXN_CLOSE when the HttpSM is really shut down. In my opinion, the proposed fix is good. |
|
Nice, was planning on looking at this issue. |
|
For workaround fix, I'm fine with this. But I agree with oknet, we should revisit design of ProxyTransaction and VConnection. |
|
Let’s open an issue to trace this case. |
|
link to #5052 |
|
@shinrich talked to me about this, and convinced me this is the correct approach. The key point was the |
|
Yes, I introduced remove_entry because the NetVC will be destroyed after we return back to NetHandler. And the HttpSM::kill_this should not access vio anymore (in HttpSM::kill_this ----->vc_table.cleanup_all) . Is it possible to do |
|
I will merge this PR if there is no objection. |
|
+1 on the merge. In terms of the concern about the semantics of ::do_io_close on the ua_txn object. Would it be clearer and more consistent if we named that function ::release instead so there was no expectation that the ua_txn object was inaccessible after the call? So ua_txn->release() (which would still call do_io_close on the underlying netvc) |
|
IIUC, When some one want to call IIUC,
I think these are different semantics. |
Based on #4873, The ua_txn set to nullptr,
transaction_doneis never called by HttpSM. So the Session is never freed.