trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From z..@apache.org
Subject git commit: TS-1164 fix a race condition in cache init.
Date Tue, 10 Apr 2012 15:42:08 GMT
Updated Branches:
  refs/heads/master 170c7712c -> 1df0305b7


TS-1164 fix a race condition in cache init.

In system with many cpu & disks, in some case the cache storage will
fail to init, you will not get a 'cache enabled' message in the
traffic.out.

Signed-off-by: Zhao Yongming <ming.zym@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/1df0305b
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/1df0305b
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/1df0305b

Branch: refs/heads/master
Commit: 1df0305b798a725dbbc1b44a1522936a425de8eb
Parents: 170c771
Author: taorui <taorui.wj@taobao.com>
Authored: Sat Mar 24 00:06:33 2012 +0800
Committer: Zhao Yongming <ming.zym@gmail.com>
Committed: Tue Apr 10 23:40:42 2012 +0800

----------------------------------------------------------------------
 CHANGES               |    2 ++
 iocore/cache/Cache.cc |    4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1df0305b/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index cc1e17d..08f7447 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,7 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 3.1.4
+  *) [TS-1164] a race condition in cache init
+
   *) [TS-1079] Add an API function to turn debugging on for specific
    transactions/sessions. This also adds a new Debug() functionality in
    both core and APIs. Author: Uri Shachar.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1df0305b/iocore/cache/Cache.cc
----------------------------------------------------------------------
diff --git a/iocore/cache/Cache.cc b/iocore/cache/Cache.cc
index 31102eb..064058a 100644
--- a/iocore/cache/Cache.cc
+++ b/iocore/cache/Cache.cc
@@ -607,10 +607,10 @@ CacheProcessor::start_internal(int flags)
 void
 CacheProcessor::diskInitialized()
 {
-  ink_atomic_increment(&initialize_disk, 1);
+  int n_init = ink_atomic_increment(&initialize_disk, 1);
   int bad_disks = 0;
   int res = 0;
-  if (initialize_disk == gndisks) {
+  if (n_init == gndisks - 1) {
 
     int i;
     for (i = 0; i < gndisks; i++) {


Mime
View raw message