当我尝试创建Heron的自定义调度器,并使用SchedulerStateManagerApaptor对象更新拓扑时,发生了以下异常:
Exception in thread java.util.ConcurrentModificationException: The update lock can not be obtained for topology AuroraMonitorSentenceWordCountTopology. Another actor is performing an update on it. Failing this request, try again once current update is complete
at com.twitter.heron.scheduler.UpdateTopologyManager.updateTopology(UpdateTopologyManager.java:117)
at zyt.custom.my.scheduler.aurora.AuroraHotEdgeSchedulerWithTxtLog.triggerSchedule(AuroraHotEdgeSchedulerWithTxtLog.java:323)
at zyt.custom.my.scheduler.aurora.AuroraHotEdgeSchedulerWithTxtLog.access$400(AuroraHotEdgeSchedulerWithTxtLog.java:55)
at zyt.custom.my.scheduler.aurora.AuroraHotEdgeSchedulerWithTxtLog$2.run(AuroraHotEdgeSchedulerWithTxtLog.java:258)
at java.lang.Thread.run(Thread.java:748)实例化SchedulerStateManagerAdaptor对象的代码如下:
Config config = Config.toClusterMode(this.config);
String stateMgrClass = Context.stateManagerClass(config); // get state manager instance
IStateManager stateMgr = null;
try {
stateMgr = ReflectionUtils.newInstance(stateMgrClass);
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
e.printStackTrace();
}
stateMgr.initialize(config);
return stateManagerAdaptor = new SchedulerStateManagerAdaptor(stateMgr, 1000); // 5000: timeout如何修复此异常?谢谢你的帮忙!
发布于 2018-07-04 00:16:04
您是否正在尝试创建一个新的Aurora调度程序?
发布于 2018-07-04 02:17:51
根据异常消息,当调度第二个更新操作时,有一个更新操作正在进行。第一个正在进行的操作阻止了第二个操作的进行。
那么,您可以干净利落地尝试更新操作吗?另外,请检查更新完成后,您的实现是否正确地释放了锁?
https://stackoverflow.com/questions/51150431
复制相似问题