Esper:在 esper 中移动模式 in/out 孤立状态时出现 StackOverflowError

Esper: StackOverflowError when moving patterns in/out isolated state in esper

我想 initialized/updated 从历史数据中获取模式的状态,并且在某些情况下经常会出现 WhosebugError。我写了一个简单的例子来演示:

public class Main {
EsperPatternWhosebug.zip
    public static void main(String[] args) {
        Configuration configuration = new Configuration();
        configuration.addEventType("TestEvent", TestEvent.class);
        configuration.getEngineDefaults().getViewResources().setShareViews(false);
        configuration.getEngineDefaults().getExecution().setAllowIsolatedService(true);
        EPServiceProvider epService = EPServiceProviderManager.getDefaultProvider(configuration);
        epService.initialize();

        EPServiceProviderIsolated isolatedService = epService.getEPServiceIsolated("Isolated");
        EPStatement stmt = isolatedService.getEPAdministrator().createEPL("select * from pattern [every (a=TestEvent -> b=TestEvent(theString=a.theString)) where timer:within(1 day)]", "TestStatement",null);
        int hour_ms = 60*60*1000;
        isolatedService.getEPRuntime().sendEvent(new CurrentTimeEvent(System.currentTimeMillis()- 2*hour_ms));
        isolatedService.getEPRuntime().sendEvent(new TestEvent("str1", 1));
         stmt.addListener((newEvents, oldEvents) -> {
            System.out.println("Fired");
        });
        isolatedService.getEPAdministrator().removeStatement(stmt);
        epService.getEPRuntime().sendEvent(new TestEvent("str1", 3));
    }
}

TestEvent 是一个简单的 class,具有两个字段:int theInt、String theString。

结果:

Exception in thread "main" java.lang.WhosebugError
        at com.espertech.esper.filter.FilterParamIndexEquals.matchEvent(FilterParamIndexEquals.java:29)
        at com.espertech.esper.filter.FilterHandleSetNode.matchEvent(FilterHandleSetNode.java:99)
        at com.espertech.esper.filter.EventTypeIndex.matchType(EventTypeIndex.java:170)
        at com.espertech.esper.filter.EventTypeIndex.matchEvent(EventTypeIndex.java:108)
        at com.espertech.esper.filter.FilterServiceBase.retryableMatchEvent(FilterServiceBase.java:179)
        at com.espertech.esper.filter.FilterServiceBase.evaluateInternal(FilterServiceBase.java:109)
        at com.espertech.esper.filter.FilterServiceLockCoarse.evaluate(FilterServiceLockCoarse.java:67)
        at com.espertech.esper.core.service.EPRuntimeImpl.handleFilterFault(EPRuntimeImpl.java:1267)
        at com.espertech.esper.core.service.EPRuntimeImpl.processStatementFilterSingle(EPRuntimeImpl.java:1242)
        at com.espertech.esper.core.service.EPRuntimeImpl.handleFilterFault(EPRuntimeImpl.java:1271)
        at com.espertech.esper.core.service.EPRuntimeImpl.processStatementFilterSingle(EPRuntimeImpl.java:1242)
.......................................................................................................................................................................

我还得到了类似情况下的下一个例外(仅在最高例外点不同):

java.lang.WhosebugError
        at com.espertech.esper.event.bean.CGLibPropertyGetter.get(CGLibPropertyGetter.java:63)
        at com.espertech.esper.filter.FilterParamIndexEquals.matchEvent(FilterParamIndexEquals.java:29)
        at com.espertech.esper.filter.FilterHandleSetNode.matchEvent(FilterHandleSetNode.java:99)
        at com.espertech.esper.filter.EventTypeIndex.matchType(EventTypeIndex.java:170)
        at com.espertech.esper.filter.EventTypeIndex.matchEvent(EventTypeIndex.java:108)
        at com.espertech.esper.filter.FilterServiceBase.retryableMatchEvent(FilterServiceBase.java:179)
        at com.espertech.esper.filter.FilterServiceBase.evaluateInternal(FilterServiceBase.java:109)
        at com.espertech.esper.filter.FilterServiceLockCoarse.evaluate(FilterServiceLockCoarse.java:67)
        at com.espertech.esper.core.service.EPRuntimeImpl.handleFilterFault(EPRuntimeImpl.java:1267)
        at com.espertech.esper.core.service.EPRuntimeImpl.processStatementFilterSingle(EPRuntimeImpl.java:1242)
        at com.espertech.esper.core.service.EPRuntimeImpl.handleFilterFault(EPRuntimeImpl.java:1271)
        at com.espertech.esper.core.service.EPRuntimeImpl.processStatementFilterSingle(EPRuntimeImpl.java:1242)
......................................................................................................................................................................

为什么会抛出这个异常,我该如何解决这个问题? 谢谢。

已在 5.5.0 版本中修复

来自更新日志(https://github.com/espertechinc/esper/blob/master/changelog.txt):

错误修复 - 修复问题 ESC-000-00001 堆栈溢出创建隔离模式语句,部分完成模式和取消隔离 stmt