From 27f66d41a568579c4dc9c926b4b3205c748f8b20 Mon Sep 17 00:00:00 2001 From: David Calavera Date: Wed, 28 Sep 2016 17:52:43 -0700 Subject: [PATCH] [TS-4908] Remove duplicated cancelling event. The HTTP2Stream is cancells the event twice when the transaction is done. In debug mode, this causes an assertion error because it tries to cancel an already cancelled event: https://github.com/apache/trafficserver/blob/master/iocore/eventsystem/I_Action.h#L137 Signed-off-by: David Calavera --- proxy/http2/Http2Stream.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/proxy/http2/Http2Stream.cc b/proxy/http2/Http2Stream.cc index 1750b049755..8b80d1b9c15 100644 --- a/proxy/http2/Http2Stream.cc +++ b/proxy/http2/Http2Stream.cc @@ -344,8 +344,10 @@ void Http2Stream::transaction_done() { SCOPED_MUTEX_LOCK(lock, this->mutex, this_ethread()); - if (cross_thread_event != NULL) + if (cross_thread_event) { cross_thread_event->cancel(); + cross_thread_event = NULL; + } if (!closed) do_io_close(); // Make sure we've been closed. If we didn't close the parent session better still be open @@ -354,8 +356,7 @@ Http2Stream::transaction_done() if (closed) { // Safe to initiate SSN_CLOSE if this is the last stream - if (cross_thread_event) - cross_thread_event->cancel(); + ink_assert(cross_thread_event == NULL); // Schedule the destroy to occur after we unwind here. IF we call directly, may delete with reference on the stack. cross_thread_event = this->get_thread()->schedule_imm(this, VC_EVENT_EOS, NULL); }