calcite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jh...@apache.org
Subject [41/50] [abbrv] calcite git commit: [CALCITE-1060] Fix test deadlock by initializing DriverManager before registering AlternatingDriver
Date Sat, 23 Jan 2016 00:30:59 GMT
[CALCITE-1060] Fix test deadlock by initializing DriverManager before registering AlternatingDriver

Early DriverManager initialization is required to prevent
Driver.<clinit> -> DriverManager.findServiceProviders -> Class.forName("Driver")
deadlock.

Note: proper resolution might need to add an entry for
"AlternatingDriver" to the service manifest.

Close apache/calcite#185


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

Branch: refs/remotes/julianhyde/master
Commit: 62576556abd0467eba7c964a90b9dc2178807f7a
Parents: af77ec8
Author: Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
Authored: Mon Jan 18 15:23:32 2016 +0300
Committer: Julian Hyde <jhyde@apache.org>
Committed: Mon Jan 18 11:02:02 2016 -0800

----------------------------------------------------------------------
 .../apache/calcite/avatica/remote/AlternatingRemoteMetaTest.java | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/calcite/blob/62576556/avatica-server/src/test/java/org/apache/calcite/avatica/remote/AlternatingRemoteMetaTest.java
----------------------------------------------------------------------
diff --git a/avatica-server/src/test/java/org/apache/calcite/avatica/remote/AlternatingRemoteMetaTest.java
b/avatica-server/src/test/java/org/apache/calcite/avatica/remote/AlternatingRemoteMetaTest.java
index ffd6f7c..6f4c51e 100644
--- a/avatica-server/src/test/java/org/apache/calcite/avatica/remote/AlternatingRemoteMetaTest.java
+++ b/avatica-server/src/test/java/org/apache/calcite/avatica/remote/AlternatingRemoteMetaTest.java
@@ -68,6 +68,10 @@ public class AlternatingRemoteMetaTest {
 
   static {
     try {
+      // Force DriverManager initialization before we hit AlternatingDriver->Driver.<clinit>
+      // Otherwise Driver.<clinit> -> DriverManager.registerDriver -> scan service
provider files
+      // causes a deadlock; see [CALCITE-1060]
+      DriverManager.getDrivers();
       DriverManager.registerDriver(new AlternatingDriver());
     } catch (SQLException e) {
       throw new RuntimeException(e);


Mime
View raw message