File tree 1 file changed +7
-0
lines changed
src/test/java/testsuite/regression
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -7867,6 +7867,8 @@ public void run() {
7867
7867
}, testConn.getClass().getSimpleName() + "@" + Integer.toHexString(System.identityHashCode(testConn)) + "_thread").start();
7868
7868
}
7869
7869
7870
+ TestBug21934573ExceptionInterceptor.initialized = true;
7871
+
7870
7872
// Let the two concurrent threads run concurrently for 2secs, at the most, before checking if they hit a deadlock situation.
7871
7873
// Wait two times 1sec as TestBug21934573ExceptionInterceptor.mainThreadLock.notify() should be called twice (once per secondary thread).
7872
7874
synchronized (TestBug21934573ExceptionInterceptor.mainThreadLock) {
@@ -7903,6 +7905,7 @@ public void run() {
7903
7905
* SQLException (not only communication related exceptions) and calls directly methods changing servers lists from ReplicationConnectionGroup.
7904
7906
*/
7905
7907
public static class TestBug21934573ExceptionInterceptor implements ExceptionInterceptor {
7908
+ static boolean initialized = false;
7906
7909
static Object mainThreadLock = new Object();
7907
7910
private static boolean threadIsWaiting = false;
7908
7911
private static final Set<String> replConnGroupLocks = Collections.synchronizedSet(new HashSet<String>());
@@ -7920,6 +7923,10 @@ public void destroy() {
7920
7923
}
7921
7924
7922
7925
public Exception interceptException(Exception sqlEx) {
7926
+ if (!initialized) {
7927
+ return sqlEx;
7928
+ }
7929
+
7923
7930
// Make sure both threads execute the code after the synchronized block concurrently.
7924
7931
synchronized (TestBug21934573ExceptionInterceptor.class) {
7925
7932
if (threadIsWaiting) {
You can’t perform that action at this time.
0 commit comments