trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From iga...@apache.org
Subject svn commit: r1146921 - in /trafficserver/traffic/branches/3.0.x: ./ CHANGES STATUS iocore/hostdb/HostDB.cc iocore/net/P_UnixNet.h iocore/net/P_UnixNetVConnection.h iocore/net/UnixNet.cc iocore/net/UnixNetVConnection.cc
Date Thu, 14 Jul 2011 23:34:02 GMT
Author: igalic
Date: Thu Jul 14 23:34:01 2011
New Revision: 1146921

URL: http://svn.apache.org/viewvc?rev=1146921&view=rev
Log:
Backport [TS-834]

Modified:
    trafficserver/traffic/branches/3.0.x/   (props changed)
    trafficserver/traffic/branches/3.0.x/CHANGES
    trafficserver/traffic/branches/3.0.x/STATUS
    trafficserver/traffic/branches/3.0.x/iocore/hostdb/HostDB.cc
    trafficserver/traffic/branches/3.0.x/iocore/net/P_UnixNet.h
    trafficserver/traffic/branches/3.0.x/iocore/net/P_UnixNetVConnection.h
    trafficserver/traffic/branches/3.0.x/iocore/net/UnixNet.cc
    trafficserver/traffic/branches/3.0.x/iocore/net/UnixNetVConnection.cc

Propchange: trafficserver/traffic/branches/3.0.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jul 14 23:34:01 2011
@@ -1,4 +1,4 @@
 /incubator/trafficserver/traffic/branches/dev:891823-915885
 /trafficserver/traffic/branches/ts-291:965529-991993
 /trafficserver/traffic/branches/wccp:1021790-1040544
-/trafficserver/traffic/trunk:1129268,1131080,1131473,1133066,1133071,1133639,1135769-1135770,1137111,1137775,1137844,1137846,1144096,1144746
+/trafficserver/traffic/trunk:1129268,1131080,1131473,1133066,1133071,1133639,1135769-1135770,1137111,1137775,1137844,1137846,1144094,1144096,1144746

Modified: trafficserver/traffic/branches/3.0.x/CHANGES
URL: http://svn.apache.org/viewvc/trafficserver/traffic/branches/3.0.x/CHANGES?rev=1146921&r1=1146920&r2=1146921&view=diff
==============================================================================
--- trafficserver/traffic/branches/3.0.x/CHANGES (original)
+++ trafficserver/traffic/branches/3.0.x/CHANGES Thu Jul 14 23:34:01 2011
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 
 Changes with Apache Traffic Server 3.0.1
+  *)i [TS-834] InactivityCop::check_inactivity crash
+
   *) [TS-826] TSHttpTxnErrorBodySet() can leak memory.
     Author: William Bardwell 
 

Modified: trafficserver/traffic/branches/3.0.x/STATUS
URL: http://svn.apache.org/viewvc/trafficserver/traffic/branches/3.0.x/STATUS?rev=1146921&r1=1146920&r2=1146921&view=diff
==============================================================================
--- trafficserver/traffic/branches/3.0.x/STATUS (original)
+++ trafficserver/traffic/branches/3.0.x/STATUS Thu Jul 14 23:34:01 2011
@@ -56,11 +56,6 @@ PATCHES PROPOSED TO BACKPORT FROM TRUNK:
     Jira: https://issues.apache.org/jira/browse/TS-860
     +1: zwoop, igalic
 
-  * Management: cop Crash, InactivityCop::check_inactivity, event=2, UnixNet.cc:57
-    Trunk patch: http://svn.apache.org/viewvc?rev=1144094&view=rev
-    Jira: https://issues.apache.org/jira/browse/TS-834
-    +1: zym, zwoop, jesus
-
   * API: TSFetchRestpGet(), TSFetchPageResptGet() and TSFetchUrl() have
          incorrect asserts.
     Trunk patch: http://svn.apache.org/viewvc?rev=1146414&view=rev

Modified: trafficserver/traffic/branches/3.0.x/iocore/hostdb/HostDB.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/branches/3.0.x/iocore/hostdb/HostDB.cc?rev=1146921&r1=1146920&r2=1146921&view=diff
==============================================================================
--- trafficserver/traffic/branches/3.0.x/iocore/hostdb/HostDB.cc (original)
+++ trafficserver/traffic/branches/3.0.x/iocore/hostdb/HostDB.cc Thu Jul 14 23:34:01 2011
@@ -1238,7 +1238,7 @@ HostDBContinuation::dnsPendingEvent(int 
     // we timed out, return a failure to the user
     MUTEX_TRY_LOCK_FOR(lock, action.mutex, ((Event *) e)->ethread, action.continuation);
     if (!lock) {
-      ((Event *) e)->schedule_in(HOST_DB_RETRY_PERIOD);
+      timeout = eventProcessor.schedule_in(this, HOST_DB_RETRY_PERIOD);
       return EVENT_CONT;
     }
     if (!action.cancelled && action.continuation)

Modified: trafficserver/traffic/branches/3.0.x/iocore/net/P_UnixNet.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/branches/3.0.x/iocore/net/P_UnixNet.h?rev=1146921&r1=1146920&r2=1146921&view=diff
==============================================================================
--- trafficserver/traffic/branches/3.0.x/iocore/net/P_UnixNet.h (original)
+++ trafficserver/traffic/branches/3.0.x/iocore/net/P_UnixNet.h Thu Jul 14 23:34:01 2011
@@ -246,6 +246,7 @@ public:
   QueM(UnixNetVConnection, NetState, read, ready_link) read_ready_list;
   QueM(UnixNetVConnection, NetState, write, ready_link) write_ready_list;
   Que(UnixNetVConnection, link) open_list;
+  DList(UnixNetVConnection, cop_link) cop_list;
   ASLLM(UnixNetVConnection, NetState, read, enable_link) read_enable_list;
   ASLLM(UnixNetVConnection, NetState, write, enable_link) write_enable_list;
 
@@ -457,9 +458,8 @@ read_disable(NetHandler * nh, UnixNetVCo
     }
   }
 #else
-  if (vc->next_inactivity_timeout_at)
-    if (!vc->write.enabled)
-      vc->next_inactivity_timeout_at = 0;
+  if (!vc->write.enabled)
+    vc->next_inactivity_timeout_at = 0;
 #endif
   vc->read.enabled = 0;
   nh->read_ready_list.remove(vc);
@@ -477,9 +477,8 @@ write_disable(NetHandler * nh, UnixNetVC
     }
   }
 #else
-  if (vc->next_inactivity_timeout_at)
-    if (!vc->read.enabled)
-      vc->next_inactivity_timeout_at = 0;
+  if (!vc->read.enabled)
+    vc->next_inactivity_timeout_at = 0;
 #endif
   vc->write.enabled = 0;
   nh->write_ready_list.remove(vc);

Modified: trafficserver/traffic/branches/3.0.x/iocore/net/P_UnixNetVConnection.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/branches/3.0.x/iocore/net/P_UnixNetVConnection.h?rev=1146921&r1=1146920&r2=1146921&view=diff
==============================================================================
--- trafficserver/traffic/branches/3.0.x/iocore/net/P_UnixNetVConnection.h (original)
+++ trafficserver/traffic/branches/3.0.x/iocore/net/P_UnixNetVConnection.h Thu Jul 14 23:34:01
2011
@@ -188,6 +188,7 @@ public:
   NetState read;
   NetState write;
 
+  LINK(UnixNetVConnection, cop_link);
   LINKM(UnixNetVConnection, read, ready_link)
   SLINKM(UnixNetVConnection, read, enable_link)
   LINKM(UnixNetVConnection, write, ready_link)

Modified: trafficserver/traffic/branches/3.0.x/iocore/net/UnixNet.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/branches/3.0.x/iocore/net/UnixNet.cc?rev=1146921&r1=1146920&r2=1146921&view=diff
==============================================================================
--- trafficserver/traffic/branches/3.0.x/iocore/net/UnixNet.cc (original)
+++ trafficserver/traffic/branches/3.0.x/iocore/net/UnixNet.cc Thu Jul 14 23:34:01 2011
@@ -39,61 +39,53 @@ extern "C" void fd_reify(struct ev_loop 
 // INKqa10496
 // One Inactivity cop runs on each thread once every second and
 // loops through the list of NetVCs and calls the timeouts
-struct InactivityCop:public Continuation
-{
-  InactivityCop(ProxyMutex *m):Continuation(m)
-  {
+struct InactivityCop : public Continuation {
+  InactivityCop(ProxyMutex *m):Continuation(m) {
     SET_HANDLER(&InactivityCop::check_inactivity);
   }
-  int check_inactivity(int event, Event *e)
-  {
+  int check_inactivity(int event, Event *e) {
     (void) event;
     ink_hrtime now = ink_get_hrtime();
     NetHandler *nh = get_NetHandler(this_ethread());
-    UnixNetVConnection *vc = nh->open_list.head, *vc_next = 0;
-    while (vc) {
-      vc_next = (UnixNetVConnection*)vc->link.next;
-      if (vc->inactivity_timeout_in && vc->next_inactivity_timeout_at &&
vc->next_inactivity_timeout_at < now){
+    // Copy the list and use pop() to catch any closes caused by callbacks.
+    forl_LL(UnixNetVConnection, vc, nh->open_list)
+      nh->cop_list.push(vc);
+    while (UnixNetVConnection *vc = nh->cop_list.pop()) {
+      if (vc->closed) {
+        close_UnixNetVConnection(vc, e->ethread);
+        continue;
+      } 
+      if (vc->next_inactivity_timeout_at && vc->next_inactivity_timeout_at
< now)
         vc->handleEvent(EVENT_IMMEDIATE, e);
-      } else {
-        if (vc->closed)
-          close_UnixNetVConnection(vc, e->ethread);
-      }
-      vc = vc_next;
     }
     return 0;
   }
 };
 #endif
 
-PollCont::PollCont(ProxyMutex *m, int pt):Continuation(m), net_handler(NULL), poll_timeout(pt)
-{
+PollCont::PollCont(ProxyMutex *m, int pt):Continuation(m), net_handler(NULL), poll_timeout(pt)
{
   pollDescriptor = NEW(new PollDescriptor);
   pollDescriptor->init();
   SET_HANDLER(&PollCont::pollEvent);
 }
 
-PollCont::PollCont(ProxyMutex *m, NetHandler *nh, int pt):Continuation(m), net_handler(nh),
-poll_timeout(pt)
+PollCont::PollCont(ProxyMutex *m, NetHandler *nh, int pt):Continuation(m), net_handler(nh),
poll_timeout(pt)
 {
   pollDescriptor = NEW(new PollDescriptor);
   pollDescriptor->init();
   SET_HANDLER(&PollCont::pollEvent);
 }
 
-PollCont::~PollCont()
-{
+PollCont::~PollCont() {
   delete pollDescriptor;
 }
 
 //
-// Changed by YTS Team, yamsat
 // PollCont continuation which does the epoll_wait
 // and stores the resultant events in ePoll_Triggered_Events
 //
 int
-PollCont::pollEvent(int event, Event *e)
-{
+PollCont::pollEvent(int event, Event *e) {
   (void) event;
   (void) e;
 

Modified: trafficserver/traffic/branches/3.0.x/iocore/net/UnixNetVConnection.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/branches/3.0.x/iocore/net/UnixNetVConnection.cc?rev=1146921&r1=1146920&r2=1146921&view=diff
==============================================================================
--- trafficserver/traffic/branches/3.0.x/iocore/net/UnixNetVConnection.cc (original)
+++ trafficserver/traffic/branches/3.0.x/iocore/net/UnixNetVConnection.cc Thu Jul 14 23:34:01
2011
@@ -81,9 +81,10 @@ net_activity(UnixNetVConnection *vc, ETh
       vc->inactivity_timeout = 0;
   }
 #else
-  vc->next_inactivity_timeout_at = 0;
   if (vc->inactivity_timeout_in)
     vc->next_inactivity_timeout_at = ink_get_hrtime() + vc->inactivity_timeout_in;
+  else
+    vc->next_inactivity_timeout_at = 0;
 #endif
 
 }
@@ -113,6 +114,7 @@ close_UnixNetVConnection(UnixNetVConnect
   }
   vc->active_timeout_in = 0;
   nh->open_list.remove(vc);
+  nh->cop_list.remove(vc);
   nh->read_ready_list.remove(vc);
   nh->write_ready_list.remove(vc);
   if (vc->read.in_enabled_list) {



Mime
View raw message