[trafficserver] branch master updated: MemArena: Add make method to construct objects in the arena. Update documentation.

2018-08-17 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new 60e778e  MemArena: Add make method to construct objects in the arena. 
Update documentation.
60e778e is described below

commit 60e778e177d36b6d4cb26689da2a9782821c8aa8
Author: Alan M. Carroll 
AuthorDate: Thu Jun 28 21:07:48 2018 -0500

MemArena: Add make method to construct objects in the arena.
Update documentation.
---
 doc/conf.py|   3 +-
 .../internal-libraries/MemArena.en.rst | 309 -
 lib/ts/MemArena.cc |  99 +++
 lib/ts/MemArena.h  | 161 ++-
 lib/ts/unit-tests/test_MemArena.cc |  99 +--
 5 files changed, 334 insertions(+), 337 deletions(-)

diff --git a/doc/conf.py b/doc/conf.py
index 1f09e42..54e7b10 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -167,7 +167,8 @@ pygments_style = 'sphinx'
 #modindex_common_prefix = []
 
 nitpicky = True
-nitpick_ignore = [
+nitpick_ignore = [ ('cpp:typeOrConcept', 'T')
+ , ('cpp:typeOrConcept', 'Args')
  ]
 
 # Autolink issue references.
diff --git a/doc/developer-guide/internal-libraries/MemArena.en.rst 
b/doc/developer-guide/internal-libraries/MemArena.en.rst
index 76ffdb4..6b2bc02 100644
--- a/doc/developer-guide/internal-libraries/MemArena.en.rst
+++ b/doc/developer-guide/internal-libraries/MemArena.en.rst
@@ -1,22 +1,17 @@
 .. Licensed to the Apache Software Foundation (ASF) under one
-   or more contributor license agreements.  See the NOTICE file
-   distributed with this work for additional information
-   regarding copyright ownership.  The ASF licenses this file
-   to you under the Apache License, Version 2.0 (the
-   "License"); you may not use this file except in compliance
-   with the License.  You may obtain a copy of the License at
+   or more contributor license agreements. See the NOTICE file distributed 
with this work for
+   additional information regarding copyright ownership. The ASF licenses this 
file to you under the
+   Apache License, Version 2.0 (the "License"); you may not use this file 
except in compliance with
+   the License. You may obtain a copy of the License at
 
http://www.apache.org/licenses/LICENSE-2.0
 
-   Unless required by applicable law or agreed to in writing,
-   software distributed under the License is distributed on an
-   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-   KIND, either express or implied.  See the License for the
-   specific language governing permissions and limitations
-   under the License.
-   
-.. include:: ../../common.defs
+   Unless required by applicable law or agreed to in writing, software 
distributed under the License
+   is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+   or implied. See the License for the specific language governing permissions 
and limitations under
+   the License.
 
+.. include:: ../../common.defs
 .. highlight:: cpp
 .. default-domain:: cpp
 .. |MemArena| replace:: :class:`MemArena`
@@ -26,211 +21,133 @@
 MemArena
 *
 
-|MemArena| provides a memory arena or pool for allocating memory. The intended 
use is for allocating many small chunks of memory - few, large allocations are 
best handled independently. The purpose is to amortize the cost of allocation 
of each chunk across larger allocations in a heap style. In addition the 
allocated memory is presumed to have similar lifetimes so that all of the 
memory in the arena can be de-allocatred en masse. This is a memory allocation 
style used by many cotainers - [...]
+|MemArena| provides a memory arena or pool for allocating memory. Internally 
|MemArena| reserves
+memory in large blocks and allocates pieces of those blocks when memory is 
requested. Upon
+destruction all of the reserved memory is released which also destroys all of 
the allocated memory.
+This is useful when the goal is any (or all) of trying to
+
+*  amortize allocation costs for many small allocations.
+*  create better memory locality for containers.
+*  de-allocate memory in bulk.
 
 Description
 +++
 
-|MemArena| manages an internal list of memory blocks, out of which it provides 
allocated
-blocks of memory. When an instance is destructed all the internal blocks are 
also freed. The
-expected use of this class is as an embedded memory manager for a container 
class.
-
-To support coalescence and compaction of memory, the methods 
:func:`MemArena::freeze` and
-:func:`MemArena::thaw` are provided. These create in effect generations of 
memory allocation.
-Calling :func:`MemArena::freeze` marks a generation. After this call any 
further allocations will
-be in new internal memory blocks. The corresponding 

[trafficserver] branch master updated: Increase limit on open files allowed as a service

2018-08-17 Thread dragon
This is an automated email from the ASF dual-hosted git repository.

dragon pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new 0178320  Increase limit on open files allowed as a service
0178320 is described below

commit 0178320fac5e9a3b20957aca9a03a2cf71758f5d
Author: dragon512 
AuthorDate: Wed Aug 15 14:19:58 2018 -0500

Increase limit on open files allowed as a service
---
 rc/trafficserver.service.in | 1 +
 1 file changed, 1 insertion(+)

diff --git a/rc/trafficserver.service.in b/rc/trafficserver.service.in
index 0768549..4a993df 100644
--- a/rc/trafficserver.service.in
+++ b/rc/trafficserver.service.in
@@ -25,6 +25,7 @@ EnvironmentFile=-/etc/sysconfig/trafficserver
 ExecStart=@exp_bindir@/traffic_manager $TM_DAEMON_ARGS
 Restart=on-failure
 RestartSec=5s
+LimitNOFILE=100
 ExecStopPost=/bin/sh -c ' \
 export TM_PIDFILE=$(@exp_bindir@/traffic_layout} 2>/dev/null | grep 
RUNTIMEDIR | cut -d: -f2)/manager.lock ; \
 /bin/rm -f $TM_PIDFILE ; \



[trafficserver] branch master updated: adding a Mutex to the continuation

2018-08-17 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new d846436  adding a Mutex to the continuation
d846436 is described below

commit d846436ab22ea8c0283bd7656d2305974e79f8d1
Author: dmorilha 
AuthorDate: Fri Aug 10 08:40:38 2018 -0700

adding a Mutex to the continuation
---
 plugins/stats_over_http/stats_over_http.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugins/stats_over_http/stats_over_http.c 
b/plugins/stats_over_http/stats_over_http.c
index 72d4675..90356f2 100644
--- a/plugins/stats_over_http/stats_over_http.c
+++ b/plugins/stats_over_http/stats_over_http.c
@@ -329,6 +329,6 @@ init:
 
   /* Create a continuation with a mutex as there is a shared global structure
  containing the headers to add */
-  TSHttpHookAdd(TS_HTTP_READ_REQUEST_HDR_HOOK, TSContCreate(stats_origin, 
NULL));
+  TSHttpHookAdd(TS_HTTP_READ_REQUEST_HDR_HOOK, TSContCreate(stats_origin, 
TSMutexCreate()));
   TSDebug(PLUGIN_NAME, "stats module registered");
 }



[trafficserver] branch master updated: disable address sanitizer for our own CompileParseRules binary

2018-08-17 Thread duke8253
This is an automated email from the ASF dual-hosted git repository.

duke8253 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new c9bd130  disable address sanitizer for our own CompileParseRules binary
c9bd130 is described below

commit c9bd130712c6565da4b2ca76bba0fb7c11ffb8d8
Author: dmorilha 
AuthorDate: Wed Aug 15 16:37:15 2018 -0700

disable address sanitizer for our own CompileParseRules binary
---
 lib/ts/Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/ts/Makefile.am b/lib/ts/Makefile.am
index f36b85d..e6d574c 100644
--- a/lib/ts/Makefile.am
+++ b/lib/ts/Makefile.am
@@ -228,7 +228,7 @@ BufferWriterFormat.o : AM_CPPFLAGS += -Wno-char-subscripts
 $(srcdir)/ParseRules.cc: ParseRulesCType
 
 ParseRulesCType: CompileParseRules
-   ./CompileParseRules
+   LSAN_OPTIONS='detect_leaks=0' ./CompileParseRules
 
 mkdfa_SOURCES = mkdfa.c
 



[trafficserver] branch master updated: make sure "traffic_ctl config reload" only reloads configs that changed

2018-08-17 Thread duke8253
This is an automated email from the ASF dual-hosted git repository.

duke8253 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new 8fd7ee0  make sure "traffic_ctl config reload" only reloads configs 
that changed
8fd7ee0 is described below

commit 8fd7ee003020cb8c064c5b4702f543148a183a9a
Author: Fei Deng 
AuthorDate: Thu Aug 16 15:08:33 2018 -0500

make sure "traffic_ctl config reload" only reloads configs that changed
---
 lib/records/P_RecCore.cc | 19 +++
 lib/records/RecUtils.cc  | 32 +++-
 2 files changed, 26 insertions(+), 25 deletions(-)

diff --git a/lib/records/P_RecCore.cc b/lib/records/P_RecCore.cc
index 11d800c..4a8a928 100644
--- a/lib/records/P_RecCore.cc
+++ b/lib/records/P_RecCore.cc
@@ -377,22 +377,25 @@ RecSetRecord(RecT rec_type, const char *name, RecDataT 
data_type, RecData *data,
   if ((data_type != RECD_NULL) && (r1->data_type != data_type)) {
 err = REC_ERR_FAIL;
   } else {
+bool rec_updated_p = false;
 if (data_type == RECD_NULL) {
   // If the caller didn't know the data type, they gave us a string
   // and we should convert based on the record's data type.
   ink_release_assert(data->rec_string != nullptr);
-  RecDataSetFromString(r1->data_type, &(r1->data), data->rec_string);
+  rec_updated_p = RecDataSetFromString(r1->data_type, &(r1->data), 
data->rec_string);
 } else {
-  RecDataSet(data_type, &(r1->data), data);
+  rec_updated_p = RecDataSet(data_type, &(r1->data), data);
 }
 
-r1->sync_required = REC_SYNC_REQUIRED;
-if (inc_version) {
-  r1->sync_required |= REC_INC_CONFIG_VERSION;
-}
+if (rec_updated_p) {
+  r1->sync_required = REC_SYNC_REQUIRED;
+  if (inc_version) {
+r1->sync_required |= REC_INC_CONFIG_VERSION;
+  }
 
-if (REC_TYPE_IS_CONFIG(r1->rec_type)) {
-  r1->config_meta.update_required = REC_UPDATE_REQUIRED;
+  if (REC_TYPE_IS_CONFIG(r1->rec_type)) {
+r1->config_meta.update_required = REC_UPDATE_REQUIRED;
+  }
 }
 
 if (REC_TYPE_IS_STAT(r1->rec_type) && (data_raw != nullptr)) {
diff --git a/lib/records/RecUtils.cc b/lib/records/RecUtils.cc
index 640f920..1f8637f 100644
--- a/lib/records/RecUtils.cc
+++ b/lib/records/RecUtils.cc
@@ -326,36 +326,36 @@ RecDataDiv(RecDataT type, RecData left, RecData right)
 bool
 RecDataSetFromInt64(RecDataT data_type, RecData *data_dst, int64_t data_int64)
 {
+  RecData data_src;
+
   switch (data_type) {
 #if defined(STAT_PROCESSOR)
   case RECD_FX:
 #endif
   case RECD_INT:
-data_dst->rec_int = data_int64;
+data_src.rec_int = data_int64;
 break;
 #if defined(STAT_PROCESSOR)
   case RECD_CONST:
 #endif
   case RECD_FLOAT:
-data_dst->rec_float = (float)(data_int64);
+data_src.rec_float = (float)(data_int64);
 break;
   case RECD_STRING: {
 char buf[32 + 1];
-
-ats_free(data_dst->rec_string);
 snprintf(buf, 32, "%" PRId64 "", data_int64);
-data_dst->rec_string = ats_strdup(buf);
+data_src.rec_string = ats_strdup(buf);
 break;
   }
   case RECD_COUNTER:
-data_dst->rec_counter = data_int64;
+data_src.rec_counter = data_int64;
 break;
   default:
 ink_assert(!"Unexpected RecD type");
 return false;
   }
 
-  return true;
+  return RecDataSet(data_type, data_dst, _src);
 }
 
 //-
@@ -364,36 +364,36 @@ RecDataSetFromInt64(RecDataT data_type, RecData 
*data_dst, int64_t data_int64)
 bool
 RecDataSetFromFloat(RecDataT data_type, RecData *data_dst, float data_float)
 {
+  RecData data_src;
+
   switch (data_type) {
 #if defined(STAT_PROCESSOR)
   case RECD_FX:
 #endif
   case RECD_INT:
-data_dst->rec_int = (RecInt)data_float;
+data_src.rec_int = (RecInt)data_float;
 break;
 #if defined(STAT_PROCESSOR)
   case RECD_CONST:
 #endif
   case RECD_FLOAT:
-data_dst->rec_float = (float)(data_float);
+data_src.rec_float = (float)(data_float);
 break;
   case RECD_STRING: {
 char buf[32 + 1];
-
-ats_free(data_dst->rec_string);
 snprintf(buf, 32, "%f", data_float);
-data_dst->rec_string = ats_strdup(buf);
+data_src.rec_string = ats_strdup(buf);
 break;
   }
   case RECD_COUNTER:
-data_dst->rec_counter = (RecCounter)data_float;
+data_src.rec_counter = (RecCounter)data_float;
 break;
   default:
 ink_assert(!"Unexpected RecD type");
 return false;
   }
 
-  return true;
+  return RecDataSet(data_type, data_dst, _src);
 }
 
 //-
@@ -402,7 +402,6 @@ RecDataSetFromFloat(RecDataT data_type, RecData *data_dst, 
float data_float)
 bool
 RecDataSetFromString(RecDataT