Apache Ignite服务器在合并审核事件后崩溃



在启动时,它运行良好,但在一段时间(1-2小时(后,它崩溃,服务器日志中出现以下异常。

错误1-[-ignite服务器%]:JVM将由于以下故障而立即停止:[failureCtx=FailureContext[type=CRITICAL_ERROR,err=class o.a.i.i.IgniteDeploymentCheckedException:未能获得类的部署:com.event.audit.AuditEventListener$$Lambda$1484/0x000000800a7ec40]]

public static void remoteListener(Ignite ignite) {
// This optional local callback is called for each event notification

// that passed remote predicate listener.
IgniteBiPredicate<UUID, CacheEvent> locLsnr = new IgniteBiPredicate<UUID, CacheEvent>() {
@Override public boolean apply(UUID nodeId, CacheEvent evt) {
System.out.println("Listener caught an event");
//--- My custom code to persists the event in another cache
};
IgnitePredicate<CacheEvent> remoteListener = cacheEvent -> {
return true;
};
// Register event listeners on all nodes to listen for task events.
UUID lsnrId = ignite.events(ignite.cluster()).remoteListen(locLsnr, remoteListener, EVT_CACHE_OBJECT_PUT, EVT_CACHE_OBJECT_REMOVED);
}
}

据我所知,您尝试在事件侦听器中执行缓存操作

//---我的自定义代码将事件持久化到另一个缓存中

事件侦听器是在锁下调用的,在侦听器中进行任何其他缓存操作都是不好的。我想这可能是你问题的根本原因。

尝试更改您的设计,例如,您可以将捕获的事件添加到队列中,然后在另一个线程中读取该队列,并将数据保存到另一个缓存中。

最新更新