You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by bc...@apache.org on 2016/10/14 17:26:08 UTC

[trafficserver] branch 7.0.x updated (31b7a72 -> 7db28a6)

This is an automated email from the ASF dual-hosted git repository.

bcall pushed a change to branch 7.0.x
in repository https://git-dual.apache.org/repos/asf/trafficserver.git.

      from  31b7a72   TS-4905: Set parent NULL after destroy() is called
       new  0378d3f   TS-4931: Add process limits to crash logs.
       new  dccf04d   TS-4888: Modified collapsed_forwarding plugin to return TSREMAP_NO_REMAP.
       new  7ab269c   TS-4870: Avoid marking storage offline multiple times
       new  d57a104   [TS-4908] Remove duplicated cancelling event.
       new  aaff553   TS-4925: Manager pollMgmtProcessServer stuck with EBADF.
       new  608ad8d   TS-4925: Fix static analysis check.
       new  049e984   TS-4953: Memory leaks in priority queue test
       new  7db28a6   TS-4915: Crash from hostdb in PriorityQueueLess

The 8 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.


Summary of changes:
 cmd/traffic_crashlog/procinfo.cc                   |  45 +++---
 cmd/traffic_crashlog/traffic_crashlog.cc           |   3 +
 cmd/traffic_crashlog/traffic_crashlog.h            |   9 +-
 iocore/cache/Cache.cc                              |   9 +-
 iocore/cache/P_CacheDisk.h                         |   2 +
 iocore/hostdb/P_RefCountCache.h                    |   1 -
 lib/ts/PriorityQueue.h                             |  17 ++-
 lib/ts/test_PriorityQueue.cc                       | 153 +++++++++++++++++++++
 mgmt/LocalManager.cc                               |  46 +++++--
 mgmt/utils/MgmtSocket.h                            |   6 -
 .../collapsed_forwarding/collapsed_forwarding.cc   |   8 +-
 proxy/http2/Http2Stream.cc                         |   7 +-
 12 files changed, 250 insertions(+), 56 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].

[trafficserver] 08/08: TS-4915: Crash from hostdb in PriorityQueueLess

Posted by bc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bcall pushed a commit to branch 7.0.x
in repository https://git-dual.apache.org/repos/asf/trafficserver.git

commit 7db28a68d2482685c11a44331d14f2ee35374d9f
Author: Susan Hinrichs <sh...@ieee.org>
AuthorDate: Tue Oct 11 09:20:11 2016 +0000

    TS-4915: Crash from hostdb in PriorityQueueLess
    
    (cherry picked from commit b19348c807d535192cb5059f86fbb0534d5df344)
---
 iocore/hostdb/P_RefCountCache.h |  1 -
 lib/ts/PriorityQueue.h          | 17 ++++++----
 lib/ts/test_PriorityQueue.cc    | 75 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 86 insertions(+), 7 deletions(-)

diff --git a/iocore/hostdb/P_RefCountCache.h b/iocore/hostdb/P_RefCountCache.h
index 5f69a2a..833952d 100644
--- a/iocore/hostdb/P_RefCountCache.h
+++ b/iocore/hostdb/P_RefCountCache.h
@@ -293,7 +293,6 @@ RefCountCachePartition<C>::make_space_for(unsigned int size)
     // If the first item has expired, lets evict it, and then go around again
     if (top_item->node->meta.expiry_time < now) {
       this->erase(top_item->node->meta.key);
-      expiry_queue.pop();
     } else { // if the first item isn't expired-- the rest won't be either (queue is sorted)
       return false;
     }
diff --git a/lib/ts/PriorityQueue.h b/lib/ts/PriorityQueue.h
index e7fc21a..afae433 100644
--- a/lib/ts/PriorityQueue.h
+++ b/lib/ts/PriorityQueue.h
@@ -110,7 +110,7 @@ PriorityQueue<T, Comp>::pop()
     return;
   }
 
-  _v[0] = _v[_v.length() - 1];
+  _swap(0, _v.length() - 1);
   _v.pop();
   _bubble_down(0);
 }
@@ -123,11 +123,16 @@ PriorityQueue<T, Comp>::erase(PriorityQueueEntry<T> *entry)
     return;
   }
 
-  _v[entry->index] = _v[_v.length() - 1];
-  _v.pop();
-  _bubble_down(entry->index);
-  if (!empty()) {
-    _bubble_up(entry->index);
+  ink_release_assert(entry->index < _v.length());
+  const uint32_t original_index = entry->index;
+  if (original_index != (_v.length() - 1)) {
+    // Move the erased item to the end to be popped off
+    _swap(original_index, _v.length() - 1);
+    _v.pop();
+    _bubble_down(original_index);
+    _bubble_up(original_index);
+  } else { // Otherwise, we are already at the end, just pop
+    _v.pop();
   }
 }
 
diff --git a/lib/ts/test_PriorityQueue.cc b/lib/ts/test_PriorityQueue.cc
index f1c041d..27a3258 100644
--- a/lib/ts/test_PriorityQueue.cc
+++ b/lib/ts/test_PriorityQueue.cc
@@ -384,4 +384,79 @@ REGRESSION_TEST(PriorityQueue_6)(RegressionTest *t, int /* atype ATS_UNUSED */,
   delete entry_a;
   delete entry_b;
   delete entry_c;
+
+  PQ *pq2 = new PQ();
+
+  N *w = new N(10, "W");
+  N *x = new N(20, "X");
+  N *y = new N(30, "Y");
+  N *z = new N(40, "Z");
+
+  Entry *entry_w = new Entry(w);
+  Entry *entry_x = new Entry(x);
+  Entry *entry_y = new Entry(y);
+  Entry *entry_z = new Entry(z);
+
+  pq2->push(entry_z);
+  pq2->push(entry_y);
+  pq2->push(entry_x);
+  pq2->push(entry_w);
+
+  box.check(pq2->top() == entry_w, "top should be entry_w 1");
+  pq2->erase(entry_x);
+  box.check(pq2->top() == entry_w, "top should be entry_w 2");
+  // The following two cases should test that erase preserves the index
+  pq2->erase(entry_y);
+  box.check(pq2->top() == entry_w, "top should be entry_w 3");
+  pq2->erase(entry_z);
+  box.check(pq2->top() == entry_w, "top should be entry_w 4");
+
+  delete pq2;
+
+  delete w;
+  delete x;
+  delete y;
+  delete z;
+
+  delete entry_w;
+  delete entry_x;
+  delete entry_y;
+  delete entry_z;
+}
+
+// Test erase and pop method to ensure the index entries are updated (TS-4915)
+REGRESSION_TEST(PriorityQueue_7)(RegressionTest *t, int /* atype ATS_UNUSED */, int *pstatus)
+{
+  TestBox box(t, pstatus);
+  box = REGRESSION_TEST_PASSED;
+
+  PQ *pq2 = new PQ();
+
+  N *x = new N(20, "X");
+  N *y = new N(30, "Y");
+  N *z = new N(40, "Z");
+
+  Entry *entry_x = new Entry(x);
+  Entry *entry_y = new Entry(y);
+  Entry *entry_z = new Entry(z);
+
+  pq2->push(entry_z);
+  pq2->push(entry_y);
+  pq2->push(entry_x);
+
+  box.check(pq2->top() == entry_x, "top should be entry_x");
+  pq2->pop();
+  box.check(pq2->top() == entry_y, "top should be entry_y");
+  pq2->erase(entry_y);
+  box.check(pq2->top() == entry_z, "top should be entry_z");
+
+  delete pq2;
+
+  delete x;
+  delete y;
+  delete z;
+
+  delete entry_x;
+  delete entry_y;
+  delete entry_z;
 }

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.

[trafficserver] 01/08: TS-4931: Add process limits to crash logs.

Posted by bc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bcall pushed a commit to branch 7.0.x
in repository https://git-dual.apache.org/repos/asf/trafficserver.git

commit 0378d3fe999f1ef63fd513c2004c6b61f34e742a
Author: James Peach <jp...@apache.org>
AuthorDate: Tue Oct 4 11:22:32 2016 -0700

    TS-4931: Add process limits to crash logs.
    
    Add /proc/$PID/limits to the crash log. This helps give context to
    malloc failures because we can get a reliable snapshot of any process
    limits in effect at the time.
    
    (cherry picked from commit e27aa3f7f2ce110b1e620bc63cf54ed3940a1f23)
---
 cmd/traffic_crashlog/procinfo.cc         | 45 ++++++++++++++++----------------
 cmd/traffic_crashlog/traffic_crashlog.cc |  3 +++
 cmd/traffic_crashlog/traffic_crashlog.h  |  9 ++++---
 3 files changed, 31 insertions(+), 26 deletions(-)

diff --git a/cmd/traffic_crashlog/procinfo.cc b/cmd/traffic_crashlog/procinfo.cc
index 2650543..440d303 100644
--- a/cmd/traffic_crashlog/procinfo.cc
+++ b/cmd/traffic_crashlog/procinfo.cc
@@ -50,23 +50,41 @@ procfd_readlink(pid_t pid, const char *fname)
   return resolved.release();
 }
 
-bool
-crashlog_write_regions(FILE *fp, const crashlog_target &target)
+// Suck in a file from /proc/$PID and write it out with the given label.
+static bool
+write_procfd_file(const char *filename, const char *label, FILE *fp, const crashlog_target &target)
 {
   ats_scoped_fd fd;
   textBuffer text(0);
-
-  fd = procfd_open(target.pid, "maps");
+  fd = procfd_open(target.pid, filename);
   if (fd != -1) {
     text.slurp(fd);
     text.chomp();
-    fprintf(fp, "Memory Regions:\n%.*s\n", (int)text.spaceUsed(), text.bufPtr());
+    fprintf(fp, "%s:\n%.*s\n", label, (int)text.spaceUsed(), text.bufPtr());
   }
 
   return !text.empty();
 }
 
 bool
+crashlog_write_regions(FILE *fp, const crashlog_target &target)
+{
+  return write_procfd_file("maps", "Memory Regions", fp, target);
+}
+
+bool
+crashlog_write_procstatus(FILE *fp, const crashlog_target &target)
+{
+  return write_procfd_file("status", "Process Status", fp, target);
+}
+
+bool
+crashlog_write_proclimits(FILE *fp, const crashlog_target &target)
+{
+  return write_procfd_file("limits", "Process Limits", fp, target);
+}
+
+bool
 crashlog_write_uname(FILE *fp, const crashlog_target &)
 {
   struct utsname uts;
@@ -124,23 +142,6 @@ crashlog_write_datime(FILE *fp, const crashlog_target &target)
 }
 
 bool
-crashlog_write_procstatus(FILE *fp, const crashlog_target &target)
-{
-  ats_scoped_fd fd;
-  textBuffer text(0);
-
-  fd = procfd_open(target.pid, "status");
-  if (fd != -1) {
-    text.slurp(fd);
-    text.chomp();
-
-    fprintf(fp, "Process Status:\n%s\n", text.bufPtr());
-  }
-
-  return !text.empty();
-}
-
-bool
 crashlog_write_backtrace(FILE *fp, const crashlog_target &)
 {
   TSString trace = NULL;
diff --git a/cmd/traffic_crashlog/traffic_crashlog.cc b/cmd/traffic_crashlog/traffic_crashlog.cc
index 75a62df..fff02f6 100644
--- a/cmd/traffic_crashlog/traffic_crashlog.cc
+++ b/cmd/traffic_crashlog/traffic_crashlog.cc
@@ -205,6 +205,9 @@ main(int /* argc ATS_UNUSED */, const char **argv)
   crashlog_write_procstatus(fp, target);
 
   fprintf(fp, "\n");
+  crashlog_write_proclimits(fp, target);
+
+  fprintf(fp, "\n");
   crashlog_write_regions(fp, target);
 
   fprintf(fp, "\n");
diff --git a/cmd/traffic_crashlog/traffic_crashlog.h b/cmd/traffic_crashlog/traffic_crashlog.h
index 12db3c0..ee49a17 100644
--- a/cmd/traffic_crashlog/traffic_crashlog.h
+++ b/cmd/traffic_crashlog/traffic_crashlog.h
@@ -65,14 +65,15 @@ struct crashlog_target {
 };
 
 bool crashlog_write_backtrace(FILE *, const crashlog_target &);
-bool crashlog_write_regions(FILE *, const crashlog_target &);
-bool crashlog_write_exename(FILE *, const crashlog_target &);
-bool crashlog_write_uname(FILE *, const crashlog_target &);
 bool crashlog_write_datime(FILE *, const crashlog_target &);
+bool crashlog_write_exename(FILE *, const crashlog_target &);
+bool crashlog_write_proclimits(FILE *, const crashlog_target &);
 bool crashlog_write_procname(FILE *, const crashlog_target &);
 bool crashlog_write_procstatus(FILE *, const crashlog_target &);
 bool crashlog_write_records(FILE *, const crashlog_target &);
-bool crashlog_write_siginfo(FILE *, const crashlog_target &);
+bool crashlog_write_regions(FILE *, const crashlog_target &);
 bool crashlog_write_registers(FILE *, const crashlog_target &);
+bool crashlog_write_siginfo(FILE *, const crashlog_target &);
+bool crashlog_write_uname(FILE *, const crashlog_target &);
 
 #endif /* __TRAFFIC_CRASHLOG_H__ */

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.

[trafficserver] 06/08: TS-4925: Fix static analysis check.

Posted by bc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bcall pushed a commit to branch 7.0.x
in repository https://git-dual.apache.org/repos/asf/trafficserver.git

commit 608ad8d7ed92fa24a6a035ff7d5f9b1c558ec255
Author: James Peach <jp...@apache.org>
AuthorDate: Wed Oct 5 21:08:48 2016 -0700

    TS-4925: Fix static analysis check.
    
    (cherry picked from commit 3772683de978d85f545f3bb9afa3fca6e793c0b6)
---
 mgmt/LocalManager.cc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/mgmt/LocalManager.cc b/mgmt/LocalManager.cc
index f90b342..8e91071 100644
--- a/mgmt/LocalManager.cc
+++ b/mgmt/LocalManager.cc
@@ -43,12 +43,14 @@ void
 LocalManager::mgmtCleanup()
 {
   close_socket(process_server_sockfd);
+  process_server_sockfd = ts::NO_FD;
 
   // fix me for librecords
 
   if (virt_map) {
     virt_map->rl_downAddrs(); // We are bailing done need to worry about table
   }
+
   closelog();
   return;
 }
@@ -441,7 +443,7 @@ LocalManager::pollMgmtProcessServer()
       }
 #endif
 
-      if (FD_ISSET(process_server_sockfd, &fdlist)) { /* New connection */
+      if (process_server_sockfd != ts::NO_FD && FD_ISSET(process_server_sockfd, &fdlist)) { /* New connection */
         struct sockaddr_in clientAddr;
         socklen_t clientLen = sizeof(clientAddr);
         int new_sockfd      = mgmt_accept(process_server_sockfd, (struct sockaddr *)&clientAddr, &clientLen);

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.

[trafficserver] 03/08: TS-4870: Avoid marking storage offline multiple times

Posted by bc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bcall pushed a commit to branch 7.0.x
in repository https://git-dual.apache.org/repos/asf/trafficserver.git

commit 7ab269cc245b0da6c78da5e187ea2ad2b1b8365b
Author: Gancho Tenev <gt...@gmail.com>
AuthorDate: Thu Sep 15 06:44:44 2016 -0700

    TS-4870: Avoid marking storage offline multiple times
    
    Added a CacheDisk:online flag because we cannot relay on DISK_BAD(disk)
    macro to identify if we already marked it bad. The problem is that in the
    common use-case in handle_disk_failure(), the disk is already bad when
    mark_storage_offline() is called, so we can't depend on the good->bad state
    transition to know when to update the accounting.
    
    (cherry picked from commit 7421eabf0f74da0005c25cc199b79f28ff5159de)
---
 iocore/cache/Cache.cc      | 9 ++++++++-
 iocore/cache/P_CacheDisk.h | 2 ++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/iocore/cache/Cache.cc b/iocore/cache/Cache.cc
index e4c5676..9562808 100644
--- a/iocore/cache/Cache.cc
+++ b/iocore/cache/Cache.cc
@@ -2000,6 +2000,13 @@ CacheProcessor::mark_storage_offline(CacheDisk *d ///< Target disk
   uint64_t total_dir_delete   = 0;
   uint64_t used_dir_delete    = 0;
 
+  /* Don't mark it again, it will invalidate the stats! */
+  if (!d->online) {
+    return this->has_online_storage();
+  }
+
+  d->online = false;
+
   if (!DISK_BAD(d))
     SET_DISK_BAD(d);
 
@@ -2052,7 +2059,7 @@ CacheProcessor::has_online_storage() const
 {
   CacheDisk **dptr = gdisks;
   for (int disk_no = 0; disk_no < gndisks; ++disk_no, ++dptr) {
-    if (!DISK_BAD(*dptr))
+    if (!DISK_BAD(*dptr) && (*dptr)->online)
       return true;
   }
   return false;
diff --git a/iocore/cache/P_CacheDisk.h b/iocore/cache/P_CacheDisk.h
index b391625..8d631e8 100644
--- a/iocore/cache/P_CacheDisk.h
+++ b/iocore/cache/P_CacheDisk.h
@@ -97,6 +97,7 @@ struct CacheDisk : public Continuation {
   int num_errors;
   int cleared;
   bool read_only_p;
+  bool online; /* flag marking cache disk online or offline (because of too many failures or by the operator). */
 
   // Extra configuration values
   int forced_volume_num;           ///< Volume number for this disk.
@@ -119,6 +120,7 @@ struct CacheDisk : public Continuation {
       num_errors(0),
       cleared(0),
       read_only_p(false),
+      online(true),
       forced_volume_num(-1)
   {
   }

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.

[trafficserver] 04/08: [TS-4908] Remove duplicated cancelling event.

Posted by bc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bcall pushed a commit to branch 7.0.x
in repository https://git-dual.apache.org/repos/asf/trafficserver.git

commit d57a10495dbd8a7796ca62b52b17f6eb46592c0b
Author: David Calavera <da...@gmail.com>
AuthorDate: Wed Sep 28 17:52:43 2016 -0700

    [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 <da...@gmail.com>
    (cherry picked from commit 3959a69a34a36180a81b0280700c6830720b4ad4)
---
 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 8eb35fb..d1fc00e 100644
--- a/proxy/http2/Http2Stream.cc
+++ b/proxy/http2/Http2Stream.cc
@@ -346,8 +346,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
@@ -356,8 +358,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);
   }

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.

[trafficserver] 05/08: TS-4925: Manager pollMgmtProcessServer stuck with EBADF.

Posted by bc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bcall pushed a commit to branch 7.0.x
in repository https://git-dual.apache.org/repos/asf/trafficserver.git

commit aaff55313738f6bafe458628eb178329ff8fbca0
Author: James Peach <jp...@apache.org>
AuthorDate: Mon Oct 3 21:43:57 2016 -0700

    TS-4925: Manager pollMgmtProcessServer stuck with EBADF.
    
    If the select in pollMgmtProcessServer fails with an actual error
    (EBADF, for example), it just returned back into the select loop
    and was unable to recover. This might happen if the server file
    descriptor is -1, or otherwise stale.
    
    The fix is to not put -1 into the select set, and to break the loop
    if select returns an error.
    
    (cherry picked from commit 280eaa59cc36c74c3f7d7a621e1244fe2a7fc287)
---
 mgmt/LocalManager.cc    | 42 +++++++++++++++++++++++++++++++-----------
 mgmt/utils/MgmtSocket.h |  6 ------
 2 files changed, 31 insertions(+), 17 deletions(-)

diff --git a/mgmt/LocalManager.cc b/mgmt/LocalManager.cc
index 67cad23..f90b342 100644
--- a/mgmt/LocalManager.cc
+++ b/mgmt/LocalManager.cc
@@ -384,16 +384,21 @@ LocalManager::pollMgmtProcessServer()
   int num;
   struct timeval timeout;
   fd_set fdlist;
+
+  while (1) {
 #if TS_HAS_WCCP
-  int wccp_fd = wccp_cache.getSocket();
+    int wccp_fd = wccp_cache.getSocket();
 #endif
 
-  while (1) {
-    // poll only
     timeout.tv_sec  = process_server_timeout_secs;
     timeout.tv_usec = process_server_timeout_msecs * 1000;
+
     FD_ZERO(&fdlist);
-    FD_SET(process_server_sockfd, &fdlist);
+
+    if (process_server_sockfd != ts::NO_FD) {
+      FD_SET(process_server_sockfd, &fdlist);
+    }
+
     if (watched_process_fd != ts::NO_FD) {
       FD_SET(watched_process_fd, &fdlist);
     }
@@ -406,20 +411,36 @@ LocalManager::pollMgmtProcessServer()
       time_t wccp_wait = wccp_cache.waitTime();
       if (wccp_wait < process_server_timeout_secs)
         timeout.tv_sec = wccp_wait;
-      FD_SET(wccp_cache.getSocket(), &fdlist);
+
+      if (wccp_fd != ts::NO_FD) {
+        FD_SET(wccp_fd, &fdlist);
+      }
     }
 #endif
 
     num = mgmt_select(FD_SETSIZE, &fdlist, NULL, NULL, &timeout);
-    if (num == 0) { /* Have nothing */
-      break;
-    } else if (num > 0) { /* Have something */
+
+    switch (num) {
+    case 0:
+      // Timed out, nothing to do.
+      return;
+    case -1:
+      if (mgmt_transient_error()) {
+        continue;
+      }
+
+      mgmt_log("[LocalManager::pollMgmtProcessServer] select failed: %s (%d)\n", ::strerror(errno), errno);
+      return;
+
+    default:
+
 #if TS_HAS_WCCP
       if (wccp_fd != ts::NO_FD && FD_ISSET(wccp_fd, &fdlist)) {
         wccp_cache.handleMessage();
         --num;
       }
 #endif
+
       if (FD_ISSET(process_server_sockfd, &fdlist)) { /* New connection */
         struct sockaddr_in clientAddr;
         socklen_t clientLen = sizeof(clientAddr);
@@ -456,6 +477,7 @@ LocalManager::pollMgmtProcessServer()
         } else if (res < 0) {
           mgmt_fatal(0, "[LocalManager::pollMgmtProcessServer] Error in read (errno: %d)\n", -res);
         }
+
         // handle EOF
         if (res == 0) {
           int estatus;
@@ -488,10 +510,8 @@ LocalManager::pollMgmtProcessServer()
 
         num--;
       }
-      ink_assert(num == 0); /* Invariant */
 
-    } else if (num < 0) { /* Error */
-      mgmt_log("[LocalManager::pollMgmtProcessServer] select failed or was interrupted (%d)\n", errno);
+      ink_assert(num == 0); /* Invariant */
     }
   }
 }
diff --git a/mgmt/utils/MgmtSocket.h b/mgmt/utils/MgmtSocket.h
index eaac8be..ab10027 100644
--- a/mgmt/utils/MgmtSocket.h
+++ b/mgmt/utils/MgmtSocket.h
@@ -27,12 +27,6 @@
 #include "ts/ink_platform.h"
 
 //-------------------------------------------------------------------------
-// defines
-//-------------------------------------------------------------------------
-
-#define MGMT_MAX_TRANSIENT_ERRORS 64
-
-//-------------------------------------------------------------------------
 // transient_error
 //-------------------------------------------------------------------------
 

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.

[trafficserver] 07/08: TS-4953: Memory leaks in priority queue test

Posted by bc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bcall pushed a commit to branch 7.0.x
in repository https://git-dual.apache.org/repos/asf/trafficserver.git

commit 049e9849725a87a2b1b9567ceed53e87f1785242
Author: Bryan Call <bc...@apache.org>
AuthorDate: Tue Oct 11 10:49:48 2016 -0700

    TS-4953: Memory leaks in priority queue test
    
    (cherry picked from commit 5b1901410e04ff76a8e508b848c7a6cd53175a07)
---
 lib/ts/test_PriorityQueue.cc | 78 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 78 insertions(+)

diff --git a/lib/ts/test_PriorityQueue.cc b/lib/ts/test_PriorityQueue.cc
index 10d82ac..f1c041d 100644
--- a/lib/ts/test_PriorityQueue.cc
+++ b/lib/ts/test_PriorityQueue.cc
@@ -74,6 +74,10 @@ REGRESSION_TEST(PriorityQueue_1)(RegressionTest *t, int /* atype ATS_UNUSED */,
 
   pq->pop();
   box.check(pq->top() == NULL, "top should be NULL");
+
+  delete pq;
+  delete a;
+  delete entry_a;
 }
 
 // Increase weight
@@ -107,6 +111,16 @@ REGRESSION_TEST(PriorityQueue_2)(RegressionTest *t, int /* atype ATS_UNUSED */,
   pq->update(entry_b, true);
 
   box.check(pq->top() == entry_c, "top should be entry_c");
+
+  delete pq;
+
+  delete a;
+  delete b;
+  delete c;
+
+  delete entry_a;
+  delete entry_b;
+  delete entry_c;
 }
 
 // Decrease weight
@@ -140,6 +154,16 @@ REGRESSION_TEST(PriorityQueue_3)(RegressionTest *t, int /* atype ATS_UNUSED */,
   pq->update(entry_c, false);
 
   box.check(pq->top() == entry_c, "top should be entry_c");
+
+  delete pq;
+
+  delete a;
+  delete b;
+  delete c;
+
+  delete entry_a;
+  delete entry_b;
+  delete entry_c;
 }
 
 // Push, top, and pop 9 entries
@@ -200,6 +224,28 @@ REGRESSION_TEST(PriorityQueue_4)(RegressionTest *t, int /* atype ATS_UNUSED */,
   pq->pop();
 
   box.check(pq->top() == NULL, "top should be NULL");
+
+  delete pq;
+
+  delete a;
+  delete b;
+  delete c;
+  delete d;
+  delete e;
+  delete f;
+  delete g;
+  delete h;
+  delete i;
+
+  delete entry_a;
+  delete entry_b;
+  delete entry_c;
+  delete entry_d;
+  delete entry_e;
+  delete entry_f;
+  delete entry_g;
+  delete entry_h;
+  delete entry_i;
 }
 
 // // Push, top, pop, and update 9 entries
@@ -276,6 +322,28 @@ REGRESSION_TEST(PriorityQueue_5)(RegressionTest *t, int /* atype ATS_UNUSED */,
   pq->pop();
 
   box.check(pq->top() == NULL, "top should be NULL");
+
+  delete pq;
+
+  delete a;
+  delete b;
+  delete c;
+  delete d;
+  delete e;
+  delete f;
+  delete g;
+  delete h;
+  delete i;
+
+  delete entry_a;
+  delete entry_b;
+  delete entry_c;
+  delete entry_d;
+  delete entry_e;
+  delete entry_f;
+  delete entry_g;
+  delete entry_h;
+  delete entry_i;
 }
 
 // Test erase method
@@ -306,4 +374,14 @@ REGRESSION_TEST(PriorityQueue_6)(RegressionTest *t, int /* atype ATS_UNUSED */,
   pq->erase(entry_b);
   box.check(pq->top() == NULL, "top should be NULL");
   box.check(pq->empty(), "should be empty");
+
+  delete pq;
+
+  delete a;
+  delete b;
+  delete c;
+
+  delete entry_a;
+  delete entry_b;
+  delete entry_c;
 }

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.

[trafficserver] 02/08: TS-4888: Modified collapsed_forwarding plugin to return TSREMAP_NO_REMAP.

Posted by bc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bcall pushed a commit to branch 7.0.x
in repository https://git-dual.apache.org/repos/asf/trafficserver.git

commit dccf04d1f47b4696c3e41eb2f84a6864bd37e217
Author: rb304g <rb...@att.com>
AuthorDate: Fri Sep 23 17:56:37 2016 +0000

    TS-4888: Modified collapsed_forwarding plugin to return TSREMAP_NO_REMAP.
    
    (cherry picked from commit 86aa59447ae2cf8f331d2fc63e4a2758ca1f3c38)
---
 plugins/experimental/collapsed_forwarding/collapsed_forwarding.cc | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/plugins/experimental/collapsed_forwarding/collapsed_forwarding.cc b/plugins/experimental/collapsed_forwarding/collapsed_forwarding.cc
index 00c56de..fb2c5dc 100644
--- a/plugins/experimental/collapsed_forwarding/collapsed_forwarding.cc
+++ b/plugins/experimental/collapsed_forwarding/collapsed_forwarding.cc
@@ -309,5 +309,11 @@ TSRemapDoRemap(void *ih, TSHttpTxn rh, TSRemapRequestInfo *rri)
   TSHttpTxnHookAdd(rh, TS_HTTP_READ_RESPONSE_HDR_HOOK, cont);
   TSHttpTxnHookAdd(rh, TS_HTTP_OS_DNS_HOOK, cont);
 
-  return TSREMAP_DID_REMAP;
+  return TSREMAP_NO_REMAP;
+}
+
+void
+TSRemapDeleteInstance(void *ih)
+{
+  // To resolve run time error
 }

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.