Return-Path: X-Original-To: apmail-trafficserver-commits-archive@www.apache.org Delivered-To: apmail-trafficserver-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6671775F8 for ; Mon, 5 Dec 2011 02:41:49 +0000 (UTC) Received: (qmail 15903 invoked by uid 500); 5 Dec 2011 02:41:49 -0000 Delivered-To: apmail-trafficserver-commits-archive@trafficserver.apache.org Received: (qmail 15834 invoked by uid 500); 5 Dec 2011 02:41:49 -0000 Mailing-List: contact commits-help@trafficserver.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@trafficserver.apache.org Delivered-To: mailing list commits@trafficserver.apache.org Received: (qmail 15827 invoked by uid 99); 5 Dec 2011 02:41:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Dec 2011 02:41:48 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Dec 2011 02:41:47 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 8A0BC238889B; Mon, 5 Dec 2011 02:41:26 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1210315 - in /trafficserver/traffic/trunk: CHANGES iocore/eventsystem/I_EventProcessor.h iocore/eventsystem/I_VConnection.h iocore/net/UnixNetVConnection.cc Date: Mon, 05 Dec 2011 02:41:26 -0000 To: commits@trafficserver.apache.org From: zwoop@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111205024126.8A0BC238889B@eris.apache.org> Author: zwoop Date: Mon Dec 5 02:41:25 2011 New Revision: 1210315 URL: http://svn.apache.org/viewvc?rev=1210315&view=rev Log: TS-857 Revert this change Modified: trafficserver/traffic/trunk/CHANGES trafficserver/traffic/trunk/iocore/eventsystem/I_EventProcessor.h trafficserver/traffic/trunk/iocore/eventsystem/I_VConnection.h trafficserver/traffic/trunk/iocore/net/UnixNetVConnection.cc Modified: trafficserver/traffic/trunk/CHANGES URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/CHANGES?rev=1210315&r1=1210314&r2=1210315&view=diff ============================================================================== --- trafficserver/traffic/trunk/CHANGES (original) +++ trafficserver/traffic/trunk/CHANGES Mon Dec 5 02:41:25 2011 @@ -14,8 +14,6 @@ Changes with Apache Traffic Server 3.1.1 *) [TS-1016] Make the update frequency for stats configurable. - *) [TS-857] Fixed cross thread corruption in closing Virtual Connections. - *) [TS-944] Align all configurations of paths to use the same function *) [TS-1018] Remove obsolete OpenSSL acceleration code and configs Modified: trafficserver/traffic/trunk/iocore/eventsystem/I_EventProcessor.h URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/eventsystem/I_EventProcessor.h?rev=1210315&r1=1210314&r2=1210315&view=diff ============================================================================== --- trafficserver/traffic/trunk/iocore/eventsystem/I_EventProcessor.h (original) +++ trafficserver/traffic/trunk/iocore/eventsystem/I_EventProcessor.h Mon Dec 5 02:41:25 2011 @@ -119,11 +119,13 @@ public: /** Schedules the continuation on a specific EThread to receive an event - as soon as possible. Instructs the EventProcessor to schedule the - callback to the continuation 'c' as soon as possible. The event is - assigned to the specified EThread. + at the given timeout. Requests the EventProcessor to schedule + the callback to the continuation 'c' at the time specified in + 'atimeout_at'. The event is assigned to the specified EThread. - @param c Continuation to be called back as soon as possible. + @param c Continuation to be called back at the time specified in + 'atimeout_at'. + @param atimeout_at time value at which to callback. @param ethread EThread on which to schedule the event. @param callback_event code to be passed back to the continuation's handler. See the Remarks section. Modified: trafficserver/traffic/trunk/iocore/eventsystem/I_VConnection.h URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/eventsystem/I_VConnection.h?rev=1210315&r1=1210314&r2=1210315&view=diff ============================================================================== --- trafficserver/traffic/trunk/iocore/eventsystem/I_VConnection.h (original) +++ trafficserver/traffic/trunk/iocore/eventsystem/I_VConnection.h Mon Dec 5 02:41:25 2011 @@ -90,19 +90,6 @@ #define VC_EVENT_OOB_COMPLETE (VC_EVENT_EVENTS_START+7) -/** The VC should close itself. - This is use to signal the VC to close across threads. This avoids - excessive locking while preventing thread content that leads to - mangled VCs and crashes. - - This is used only when a VC is ordered closed but the call chain is - on the wrong thread. An event of this type is scheduled on the main - thread for the VC (as determined by the NetHandler holding the - mutex). -*/ - -# define VC_EVENT_DO_CLOSE (VC_EVENT_EVENTS_START+8) - // // Event names // Modified: trafficserver/traffic/trunk/iocore/net/UnixNetVConnection.cc URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/net/UnixNetVConnection.cc?rev=1210315&r1=1210314&r2=1210315&view=diff ============================================================================== --- trafficserver/traffic/trunk/iocore/net/UnixNetVConnection.cc (original) +++ trafficserver/traffic/trunk/iocore/net/UnixNetVConnection.cc Mon Dec 5 02:41:25 2011 @@ -545,7 +545,6 @@ UnixNetVConnection::do_io_write(Continua void UnixNetVConnection::do_io_close(int alerrno /* = -1 */ ) { - EThread *t = this_ethread(); disable_read(this); disable_write(this); read.vio.buffer.clear(); @@ -558,24 +557,15 @@ UnixNetVConnection::do_io_close(int aler INK_WRITE_MEMORY_BARRIER; if (alerrno && alerrno != -1) this->lerrno = alerrno; - - /* If the net handler is on a different thread, we don't want to close - because we can mess up that other thread. We don't want to lock because - that could cause deadlock. Instead we'll schedule the close for the - NH thread. - */ - if (nh->mutex->thread_holding != t) { - nh->mutex->thread_holding->schedule_imm(this, VC_EVENT_DO_CLOSE); - return; - } - if (alerrno == -1) closed = 1; else closed = -1; if (!recursion) { - close_UnixNetVConnection(this, t); + EThread *t = this_ethread(); + if (nh->mutex->thread_holding == t) + close_UnixNetVConnection(this, t); } } @@ -969,7 +959,7 @@ UnixNetVConnection::acceptEvent(int even int UnixNetVConnection::mainEvent(int event, Event *e) { - ink_debug_assert(event == EVENT_IMMEDIATE || event == EVENT_INTERVAL || event == VC_EVENT_DO_CLOSE); + ink_debug_assert(event == EVENT_IMMEDIATE || event == EVENT_INTERVAL); ink_debug_assert(thread == this_ethread()); MUTEX_TRY_LOCK(hlock, get_NetHandler(thread)->mutex, e->ethread); @@ -977,26 +967,15 @@ UnixNetVConnection::mainEvent(int event, MUTEX_TRY_LOCK(wlock, write.vio.mutex ? (ProxyMutex *) write.vio.mutex : (ProxyMutex *) e->ethread->mutex, e->ethread); if (!hlock || !rlock || !wlock) { - // Don't have all the locks we need. - // Retry later if that's appropriate. - if (VC_EVENT_DO_CLOSE == event) { - e->schedule_in(NET_RETRY_DELAY, event); - } else { #ifndef INACTIVITY_TIMEOUT - if (e == active_timeout) + if (e == active_timeout) #endif e->schedule_in(NET_RETRY_DELAY); - } return EVENT_CONT; } if (e->cancelled) return EVENT_DONE; - if (VC_EVENT_DO_CLOSE == event) { - close_UnixNetVConnection(this, thread); - return EVENT_DONE; - } - int signal_event; Event **signal_timeout; Continuation *reader_cont = NULL;