Skip to content

Commit 64ba553

Browse files
authored
Merge pull request #78 from osheroff/fix_deadlock
Fix deadlock
2 parents 334c405 + c544bc0 commit 64ba553

File tree

3 files changed

+10
-14
lines changed

3 files changed

+10
-14
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
command: echo "testing under mysql $MYSQL_VERSION"
3636
- run:
3737
name: testit
38-
command: mvn verify
38+
command: mvn verify -Dgpg.skip
3939
- store_artifacts:
4040
path: test.log
4141

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>com.zendesk</groupId>
66
<artifactId>mysql-binlog-connector-java</artifactId>
7-
<version>0.25.6</version>
7+
<version>0.26.0</version>
88

99
<name>mysql-binlog-connector-java</name>
1010
<description>MySQL Binary Log connector</description>

src/main/java/com/github/shyiko/mysql/binlog/BinaryLogClient.java

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -794,17 +794,13 @@ public void run() {
794794
}
795795
}
796796
if (connectionLost) {
797-
if (logger.isLoggable(Level.INFO)) {
798-
logger.info("Trying to restore lost connection to " + hostname + ":" + port);
799-
}
797+
logger.info("Keepalive: Trying to restore lost connection to " + hostname + ":" + port);
800798
try {
801799
terminateConnect();
802800
connect(connectTimeout);
803801
} catch (Exception ce) {
804-
if (logger.isLoggable(Level.WARNING)) {
805-
logger.warning("Failed to restore connection to " + hostname + ":" + port +
806-
". Next attempt in " + keepAliveInterval + "ms");
807-
}
802+
logger.warning("keepalive: Failed to restore connection to " + hostname + ":" + port +
803+
". Next attempt in " + keepAliveInterval + "ms");
808804
}
809805
}
810806
}
@@ -1182,17 +1178,17 @@ private void terminateKeepAliveThread() {
11821178
try {
11831179
keepAliveThreadExecutorLock.lock();
11841180
ExecutorService keepAliveThreadExecutor = this.keepAliveThreadExecutor;
1185-
if (keepAliveThreadExecutor == null) {
1181+
if ( keepAliveThreadExecutor == null ) {
11861182
return;
11871183
}
11881184
keepAliveThreadExecutor.shutdownNow();
1189-
while (!awaitTerminationInterruptibly(keepAliveThreadExecutor,
1190-
Long.MAX_VALUE, TimeUnit.NANOSECONDS)) {
1191-
// ignore
1192-
}
11931185
} finally {
11941186
keepAliveThreadExecutorLock.unlock();
11951187
}
1188+
while (!awaitTerminationInterruptibly(keepAliveThreadExecutor,
1189+
Long.MAX_VALUE, TimeUnit.NANOSECONDS)) {
1190+
// ignore
1191+
}
11961192
}
11971193

11981194
private static boolean awaitTerminationInterruptibly(ExecutorService executorService, long timeout, TimeUnit unit) {

0 commit comments

Comments
 (0)