asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mb...@apache.org
Subject asterixdb git commit: Fix Race Condition in Hyracks/AlgebricksException
Date Sat, 25 Feb 2017 01:02:08 GMT
Repository: asterixdb
Updated Branches:
  refs/heads/master c05f01522 -> bcdc2ab7d


Fix Race Condition in Hyracks/AlgebricksException

Instantiation of message must be synchronized

Change-Id: I2879e293af78ec54b3201a748981c32faa481f1a
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1515
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Till Westmann <tillw@apache.org>


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

Branch: refs/heads/master
Commit: bcdc2ab7d479796ffadeab385aba9236cf2e67de
Parents: c05f015
Author: Michael Blow <mblow@apache.org>
Authored: Mon Feb 20 07:46:51 2017 -0500
Committer: Michael Blow <mblow@apache.org>
Committed: Fri Feb 24 17:00:25 2017 -0800

----------------------------------------------------------------------
 .../algebricks/common/exceptions/AlgebricksException.java        | 4 +++-
 .../java/org/apache/hyracks/api/exceptions/HyracksException.java | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/bcdc2ab7/hyracks-fullstack/algebricks/algebricks-common/src/main/java/org/apache/hyracks/algebricks/common/exceptions/AlgebricksException.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/algebricks/algebricks-common/src/main/java/org/apache/hyracks/algebricks/common/exceptions/AlgebricksException.java
b/hyracks-fullstack/algebricks/algebricks-common/src/main/java/org/apache/hyracks/algebricks/common/exceptions/AlgebricksException.java
index 774c4d9..b1f0892 100644
--- a/hyracks-fullstack/algebricks/algebricks-common/src/main/java/org/apache/hyracks/algebricks/common/exceptions/AlgebricksException.java
+++ b/hyracks-fullstack/algebricks/algebricks-common/src/main/java/org/apache/hyracks/algebricks/common/exceptions/AlgebricksException.java
@@ -122,7 +122,9 @@ public class AlgebricksException extends Exception {
     @Override
     public String getMessage() {
         if (msgCache == null) {
-            msgCache = ErrorMessageUtil.formatMessage(component, errorCode, super.getMessage(),
params);
+            synchronized (this) {
+                msgCache = ErrorMessageUtil.formatMessage(component, errorCode, super.getMessage(),
params);
+            }
         }
         return msgCache;
     }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/bcdc2ab7/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/exceptions/HyracksException.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/exceptions/HyracksException.java
b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/exceptions/HyracksException.java
index 5d13212..559468d 100644
--- a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/exceptions/HyracksException.java
+++ b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/exceptions/HyracksException.java
@@ -129,7 +129,9 @@ public class HyracksException extends IOException {
     @Override
     public String getMessage() {
         if (msgCache == null) {
-            msgCache = ErrorMessageUtil.formatMessage(component, errorCode, super.getMessage(),
params);
+            synchronized (this) {
+                msgCache = ErrorMessageUtil.formatMessage(component, errorCode, super.getMessage(),
params);
+            }
         }
         return msgCache;
     }


Mime
View raw message