[trafficserver] branch master updated: Adjust the refcounts to avoid Mutex leak

2019-12-03 Thread scw00
This is an automated email from the ASF dual-hosted git repository.

scw00 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 4a503c8  Adjust the refcounts to avoid Mutex leak
4a503c8 is described below

commit 4a503c817766fcad3b9eab3ff3a8e9e73d483ae7
Author: Susan Hinrichs 
AuthorDate: Tue Nov 26 17:06:30 2019 +

Adjust the refcounts to avoid Mutex leak
---
 iocore/eventsystem/I_Lock.h| 40 +++---
 src/traffic_server/InkIOCoreAPI.cc | 19 ++
 2 files changed, 48 insertions(+), 11 deletions(-)

diff --git a/iocore/eventsystem/I_Lock.h b/iocore/eventsystem/I_Lock.h
index 4850199..c5b8373 100644
--- a/iocore/eventsystem/I_Lock.h
+++ b/iocore/eventsystem/I_Lock.h
@@ -256,7 +256,7 @@ Mutex_trylock(
 #ifdef DEBUG
   const SourceLocation , const char *ahandler,
 #endif
-  Ptr , EThread *t)
+  ProxyMutex *m, EThread *t)
 {
   ink_assert(t != nullptr);
   ink_assert(t == reinterpret_cast(this_thread()));
@@ -295,12 +295,26 @@ Mutex_trylock(
   return true;
 }
 
+inline bool
+Mutex_trylock(
+#ifdef DEBUG
+  const SourceLocation , const char *ahandler,
+#endif
+  Ptr , EThread *t)
+{
+  return Mutex_trylock(
+#ifdef DEBUG
+location, ahandler,
+#endif
+m.get(), t);
+}
+
 inline int
 Mutex_lock(
 #ifdef DEBUG
   const SourceLocation , const char *ahandler,
 #endif
-  Ptr , EThread *t)
+  ProxyMutex *m, EThread *t)
 {
   ink_assert(t != nullptr);
   if (m->thread_holding != t) {
@@ -327,8 +341,22 @@ Mutex_lock(
   return true;
 }
 
+inline int
+Mutex_lock(
+#ifdef DEBUG
+  const SourceLocation , const char *ahandler,
+#endif
+  Ptr , EThread *t)
+{
+  return Mutex_lock(
+#ifdef DEBUG
+location, ahandler,
+#endif
+m.get(), t);
+}
+
 inline void
-Mutex_unlock(Ptr , EThread *t)
+Mutex_unlock(ProxyMutex *m, EThread *t)
 {
   if (m->nthread_holding) {
 ink_assert(t == m->thread_holding);
@@ -351,6 +379,12 @@ Mutex_unlock(Ptr , EThread *t)
   }
 }
 
+inline void
+Mutex_unlock(Ptr , EThread *t)
+{
+  Mutex_unlock(m.get(), t);
+}
+
 class WeakMutexLock
 {
 private:
diff --git a/src/traffic_server/InkIOCoreAPI.cc 
b/src/traffic_server/InkIOCoreAPI.cc
index 25618ef..1740ee1 100644
--- a/src/traffic_server/InkIOCoreAPI.cc
+++ b/src/traffic_server/InkIOCoreAPI.cc
@@ -235,14 +235,17 @@ TSEventThreadSelf(void)
 
 
 //
-// Mutexes
+// Mutexes:  For TSMutexCreate and TSMutexDestroy, the refcount of the
+// ProxyMutex object is not incremented or decremented.  If the resulting
+// ProxyMutex is passed to a INKContInternal, it's mutex smart pointer
+// will take ownership of the ProxyMutex and delete it when the last
+// reference is removed.  TSMutexDestroy should not be called in that case.
 //
 
 TSMutex
 TSMutexCreate()
 {
   ProxyMutex *mutexp = new_ProxyMutex();
-  mutexp->refcount_inc();
 
   // TODO: Remove this when allocations can never fail.
   sdk_assert(sdk_sanity_check_mutex((TSMutex)mutexp) == TS_SUCCESS);
@@ -255,9 +258,9 @@ TSMutexDestroy(TSMutex m)
 {
   sdk_assert(sdk_sanity_check_mutex(m) == TS_SUCCESS);
   ProxyMutex *mutexp = reinterpret_cast(m);
-  // Decrement the refcount added in TSMutexCreate.  Delete if this
-  // was the last ref count
-  if (mutexp && mutexp->refcount_dec() == 0) {
+
+  if (mutexp) {
+ink_release_assert(mutexp->refcount() == 0);
 mutexp->free();
   }
 }
@@ -296,7 +299,7 @@ void
 TSMutexLock(TSMutex mutexp)
 {
   sdk_assert(sdk_sanity_check_mutex(mutexp) == TS_SUCCESS);
-  Ptr proxy_mutex(reinterpret_cast(mutexp));
+  ProxyMutex *proxy_mutex = reinterpret_cast(mutexp);
   MUTEX_TAKE_LOCK(proxy_mutex, this_ethread());
 }
 
@@ -304,7 +307,7 @@ TSReturnCode
 TSMutexLockTry(TSMutex mutexp)
 {
   sdk_assert(sdk_sanity_check_mutex(mutexp) == TS_SUCCESS);
-  Ptr proxy_mutex(reinterpret_cast(mutexp));
+  ProxyMutex *proxy_mutex = reinterpret_cast(mutexp);
   return (MUTEX_TAKE_TRY_LOCK(proxy_mutex, this_ethread()) ? TS_SUCCESS : 
TS_ERROR);
 }
 
@@ -312,7 +315,7 @@ void
 TSMutexUnlock(TSMutex mutexp)
 {
   sdk_assert(sdk_sanity_check_mutex(mutexp) == TS_SUCCESS);
-  Ptr proxy_mutex(reinterpret_cast(mutexp));
+  ProxyMutex *proxy_mutex(reinterpret_cast(mutexp));
   MUTEX_UNTAKE_LOCK(proxy_mutex, this_ethread());
 }
 



[trafficserver] branch master updated (0cf7e59 -> a33b43e)

2019-12-03 Thread bcall
This is an automated email from the ASF dual-hosted git repository.

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


from 0cf7e59  Fixed build issue with clang5 and Extendible
 add 84f0219  Fixing rolled log cleanup parsing for .log. files.
 add 745d38f  Review comments.
 add a33b43e  Following catch test naming standards.

No new revisions were added by this update.

Summary of changes:
 proxy/logging/LogConfig.cc | 10 +-
 proxy/logging/LogUtils.cc  | 28 
 proxy/logging/LogUtils.h   | 17 +
 proxy/logging/unit-tests/test_LogUtils2.cc | 23 +++
 4 files changed, 69 insertions(+), 9 deletions(-)



[trafficserver] branch 9.0.x updated (5f7b642 -> 79d510e)

2019-12-03 Thread bcall
This is an automated email from the ASF dual-hosted git repository.

bcall pushed a change to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git.


from 5f7b642  Cleanup trailing whitespaces, and YAML formatting (#6212)
 new 7203143  Fixed build issue with clang5 and Extendible
 new 79d510e  Updated Changelog

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


Summary of changes:
 CHANGELOG-9.0.0 | 4 
 include/tscore/Extendible.h | 5 -
 2 files changed, 8 insertions(+), 1 deletion(-)



[trafficserver] 01/02: Fixed build issue with clang5 and Extendible

2019-12-03 Thread bcall
This is an automated email from the ASF dual-hosted git repository.

bcall pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 7203143db805add26c2cdb86bd6a74d740c107a0
Author: Bryan Call 
AuthorDate: Fri Nov 22 11:10:15 2019 +0800

Fixed build issue with clang5 and Extendible

(cherry picked from commit 0cf7e5953aec06d4dafb183861afe918763cbf33)
---
 include/tscore/Extendible.h | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/tscore/Extendible.h b/include/tscore/Extendible.h
index 6e2d306..16630ed 100644
--- a/include/tscore/Extendible.h
+++ b/include/tscore/Extendible.h
@@ -720,7 +720,10 @@ serialize(std::ostream , T const )
 for (const auto  : schema.fields) {
   name_width = max(name_width, kv.first.length());
 }
-for (const auto &[fname, field] : schema.fields) {
+// TODO: clang-5 didn't like the use of a range based for here, change 
later
+for (auto it = schema.fields.begin(); it != schema.fields.end(); ++it) {
+  auto  = it->first;
+  auto  = it->second;
   ink_assert(field.serializer);
   os << setw(indent) << "" << setw(name_width) << right << fname << ": ";
   field.serializer(os, details::FieldPtrGet(t, field));



[trafficserver] 02/02: Updated Changelog

2019-12-03 Thread bcall
This is an automated email from the ASF dual-hosted git repository.

bcall pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 79d510e87bdda8901a1d998473d47f859429076c
Author: Bryan Call 
AuthorDate: Tue Dec 3 08:49:59 2019 -0800

Updated Changelog
---
 CHANGELOG-9.0.0 | 4 
 1 file changed, 4 insertions(+)

diff --git a/CHANGELOG-9.0.0 b/CHANGELOG-9.0.0
index 26c87b5..bcfeeb0 100644
--- a/CHANGELOG-9.0.0
+++ b/CHANGELOG-9.0.0
@@ -761,12 +761,14 @@ Changes with Apache Traffic Server 9.0.0
   #6000 - Add QUIC draft-23 support
   #6003 - Cleanup: do not re-define _proxy_ssn variable in local
   #6006 - Rewrote remap_stats plugin to use C++
+  #6007 - Graduate TSHttpTxnServerPush to the stable API interface
   #6008 - Do not schedule stuff during shutdown
   #6011 - clang-analyzer: Add a null check
   #6013 - Add basic SystemTap markers support
   #6016 - Fix host type in host matcher.
   #6024 - Make proxy.config.http.request_buffer_enabled configurable and bug 
fix
   #6031 - listen on all the net threads
+  #6049 - set host name in TLS extension for SNI Host check in service side 
with sni policy verify_with_name_source.
   #6054 - Ignore MgmtMessageHdr if ProcessManager is not running
   #6062 - Adding connection close headers to regex_remap test.
   #6066 - Fixing session sharing with IP matching.
@@ -817,3 +819,5 @@ Changes with Apache Traffic Server 9.0.0
   #6189 - Fixed issue with macOS Catalina and pcre 8.43 enabling pcre-jit
   #6190 - Fix ssl_session_reuse to compile on macOS and FreeBSD
   #6191 - Limit this check to Linux, where ldd always works
+  #6212 - Cleanup trailing whitespaces, and YAML formatting
+  #6224 - Fixed build issue with clang5 and Extendible