Browse Source

Merge pull request #210 from xujianhai/patch-1

不好的设计
agapple 8 years ago
parent
commit
a5d6c3b747

+ 4 - 1
parse/src/main/java/com/alibaba/otter/canal/parse/inbound/AbstractEventParser.java

@@ -388,7 +388,10 @@ public abstract class AbstractEventParser<EVENT> extends AbstractCanalLifeCycle
             String name = String.format("destination = %s , address = %s , HeartBeatTimeTask",
                 destination,
                 runningInfo == null ? null : runningInfo.getAddress().toString());
-            synchronized (MysqlEventParser.class) {
+            synchronized(AbstractEventParser.class){
+//             synchronized (MysqlEventParser.class) {
+//             why use MysqlEventParser.class, u know, MysqlEventParser is the child class 4 AbstractEventParser,
+//             do this is ...
                 if (timer == null) {
                     timer = new Timer(name, true);
                 }