mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
etl 增加同步锁
This commit is contained in:
@@ -99,12 +99,16 @@ public class EtlLock {
|
||||
}
|
||||
}
|
||||
|
||||
public void unlock(String key) throws Exception {
|
||||
public void unlock(String key) {
|
||||
if (mode == Mode.LOCAL) {
|
||||
getLock(key).unlock();
|
||||
} else {
|
||||
InterProcessMutex lock = getRemoteLock(key);
|
||||
lock.release();
|
||||
try {
|
||||
lock.release();
|
||||
} catch (Exception e) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,11 +79,7 @@ public class CommonRest {
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
etlLock.unlock(ETL_LOCK_ZK_NODE + type + "-" + task);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
}
|
||||
etlLock.unlock(ETL_LOCK_ZK_NODE + type + "-" + task);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user