{"action":"created","issue":{"url":"https://api.github.com/repos/brmson/yodaqa/issues/23","labels_url":"https://api.github.com/repos/brmson/yodaqa/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/brmson/yodaqa/issues/23/comments","events_url":"https://api.github.com/repos/brmson/yodaqa/issues/23/events","html_url":"https://github.com/brmson/yodaqa/issues/23","id":121061247,"number":23,"title":"New PrimarySearch CASMultiplier causing ConcurrentModificationException","user":{"login":"zednis","id":1057295,"avatar_url":"https://avatars.githubusercontent.com/u/1057295?v=3","gravatar_id":"","url":"https://api.github.com/users/zednis","html_url":"https://github.com/zednis","followers_url":"https://api.github.com/users/zednis/followers","following_url":"https://api.github.com/users/zednis/following{/other_user}","gists_url":"https://api.github.com/users/zednis/gists{/gist_id}","starred_url":"https://api.github.com/users/zednis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zednis/subscriptions","organizations_url":"https://api.github.com/users/zednis/orgs","repos_url":"https://api.github.com/users/zednis/repos","events_url":"https://api.github.com/users/zednis/events{/privacy}","received_events_url":"https://api.github.com/users/zednis/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-08T17:47:44Z","updated_at":"2015-12-09T05:06:26Z","closed_at":"2015-12-09T05:06:26Z","body":"I am attempting to add a new data source which references a local ElasticSearch service.\r\n\r\nI have created a EsDocPrimarySearch CAS multiplies and a EsDocAnswerProducer based on the current Solr classes and I have added EsDocPrimarySearch AE to the pipeline in YodaQA.java.\r\n\r\n~~You can see the updates in my repo's pull request - https://github.com/brmson/yodaqa/pull/22~~\r\n\r\nedit - link to pull request correctly opened in my fork - https://github.com/zednis/yodaqa/pull/1\r\n\r\nWhen I run the application I get a ConcurrentModificationException after the EsDocPrimarySearch:process method has executed.\r\n\r\nDo you have any idea why this might be happening?\r\n\r\nThanks,\r\nStephan\r\n\r\n```\r\nINFO SolrDocPrimarySearch -  QUERY: +(\"wrote\")^1.0 +(\"Ender's Game\")^1.11  (\"wrote Ender's Game \"~4)^2.1100000000000003 (\"wrote Ender's Game \"~12)^1.0550000000000002 (\"wrote Ender's Game \"~36)^0.5275000000000001\r\nDec 07, 2015 9:04:38 PM cz.brmlab.yodaqa.pipeline.esdoc.EsDocPrimarySearch process(106)\r\nINFO: querying elasticsearch for: [wrote, Ender's Game]\r\nDec 07, 2015 9:04:38 PM cz.brmlab.yodaqa.pipeline.esdoc.EsDocPrimarySearch process(117)\r\nINFO: elasticsearch response status: OK\r\nDec 07, 2015 9:04:38 PM org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl processAndOutputNewCASes(274)\r\nSEVERE: Exception occurred\r\norg.apache.uima.analysis_engine.AnalysisEngineProcessException\r\n\tat cz.brmlab.yodaqa.flow.asb.MultiThreadASB$AggregateCasIterator.processUntilNextOutputCas(MultiThreadASB.java:1074)\r\n\tat cz.brmlab.yodaqa.flow.asb.MultiThreadASB$AggregateCasIterator.<init>(MultiThreadASB.java:496)\r\n\tat cz.brmlab.yodaqa.flow.asb.MultiThreadASB.process(MultiThreadASB.java:416)\r\n\tat org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.processAndOutputNewCASes(AggregateAnalysisEngine_impl.java:266)\r\n\tat cz.brmlab.yodaqa.flow.asb.MultiThreadASB$AggregateCasIterator$1.call(MultiThreadASB.java:772)\r\n\tat cz.brmlab.yodaqa.flow.asb.MultiThreadASB$AggregateCasIterator$1.call(MultiThreadASB.java:754)\r\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:266)\r\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\r\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\r\n\tat java.lang.Thread.run(Thread.java:744)\r\nCaused by: java.util.ConcurrentModificationException\r\n\tat java.util.HashMap$HashIterator.nextNode(HashMap.java:1429)\r\n\tat java.util.HashMap$KeyIterator.next(HashMap.java:1453)\r\n\tat cz.brmlab.yodaqa.flow.asb.MultiThreadASB$AggregateCasIterator.nextCasToProcess(MultiThreadASB.java:711)\r\n\tat cz.brmlab.yodaqa.flow.asb.MultiThreadASB$AggregateCasIterator.processUntilNextOutputCas(MultiThreadASB.java:1039)\r\n\t... 9 more\r\n\r\nDec 07, 2015 9:04:38 PM org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl processAndOutputNewCASes(274)\r\nSEVERE: Exception occurred\r\norg.apache.uima.analysis_engine.AnalysisEngineProcessException\r\n\tat cz.brmlab.yodaqa.flow.asb.MultiThreadASB$AggregateCasIterator.processUntilNextOutputCas(MultiThreadASB.java:1074)\r\n\tat cz.brmlab.yodaqa.flow.asb.MultiThreadASB$AggregateCasIterator.<init>(MultiThreadASB.java:496)\r\n\tat cz.brmlab.yodaqa.flow.asb.MultiThreadASB.process(MultiThreadASB.java:416)\r\n\tat org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.processAndOutputNewCASes(AggregateAnalysisEngine_impl.java:266)\r\n\tat cz.brmlab.yodaqa.flow.MultiCASPipeline.runAnalysisEngines(MultiCASPipeline.java:135)\r\n\tat cz.brmlab.yodaqa.flow.MultiCASPipeline.runPipeline(MultiCASPipeline.java:95)\r\n\tat cz.brmlab.yodaqa.YodaQA_Web.main(YodaQA_Web.java:45)\r\nCaused by: java.util.concurrent.ExecutionException: org.apache.uima.analysis_engine.AnalysisEngineProcessException\r\n\tat java.util.concurrent.FutureTask.report(FutureTask.java:122)\r\n\tat java.util.concurrent.FutureTask.get(FutureTask.java:192)\r\n\tat cz.brmlab.yodaqa.flow.asb.MultiThreadASB$AggregateCasIterator.collectCasInFlow(MultiThreadASB.java:814)\r\n\tat cz.brmlab.yodaqa.flow.asb.MultiThreadASB$AggregateCasIterator.casInFlowFromFuture(MultiThreadASB.java:603)\r\n\tat cz.brmlab.yodaqa.flow.asb.MultiThreadASB$AggregateCasIterator.nextCasToProcess(MultiThreadASB.java:635)\r\n\tat cz.brmlab.yodaqa.flow.asb.MultiThreadASB$AggregateCasIterator.processUntilNextOutputCas(MultiThreadASB.java:1039)\r\n\t... 6 more\r\nCaused by: org.apache.uima.analysis_engine.AnalysisEngineProcessException\r\n\tat cz.brmlab.yodaqa.flow.asb.MultiThreadASB$AggregateCasIterator.processUntilNextOutputCas(MultiThreadASB.java:1074)\r\n\tat cz.brmlab.yodaqa.flow.asb.MultiThreadASB$AggregateCasIterator.<init>(MultiThreadASB.java:496)\r\n\tat cz.brmlab.yodaqa.flow.asb.MultiThreadASB.process(MultiThreadASB.java:416)\r\n\tat org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.processAndOutputNewCASes(AggregateAnalysisEngine_impl.java:266)\r\n\tat cz.brmlab.yodaqa.flow.asb.MultiThreadASB$AggregateCasIterator$1.call(MultiThreadASB.java:772)\r\n\tat cz.brmlab.yodaqa.flow.asb.MultiThreadASB$AggregateCasIterator$1.call(MultiThreadASB.java:754)\r\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:266)\r\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\r\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\r\n\tat java.lang.Thread.run(Thread.java:744)\r\nCaused by: java.util.ConcurrentModificationException\r\n\tat java.util.HashMap$HashIterator.nextNode(HashMap.java:1429)\r\n\tat java.util.HashMap$KeyIterator.next(HashMap.java:1453)\r\n\tat cz.brmlab.yodaqa.flow.asb.MultiThreadASB$AggregateCasIterator.nextCasToProcess(MultiThreadASB.java:711)\r\n\tat cz.brmlab.yodaqa.flow.asb.MultiThreadASB$AggregateCasIterator.processUntilNextOutputCas(MultiThreadASB.java:1039)\r\n\t... 9 more\r\n\r\nException in thread \"main\" org.apache.uima.analysis_engine.AnalysisEngineProcessException\r\n\tat cz.brmlab.yodaqa.flow.asb.MultiThreadASB$AggregateCasIterator.processUntilNextOutputCas(MultiThreadASB.java:1074)\r\n\tat cz.brmlab.yodaqa.flow.asb.MultiThreadASB$AggregateCasIterator.<init>(MultiThreadASB.java:496)\r\n\tat cz.brmlab.yodaqa.flow.asb.MultiThreadASB.process(MultiThreadASB.java:416)\r\n\tat org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.processAndOutputNewCASes(AggregateAnalysisEngine_impl.java:266)\r\n\tat cz.brmlab.yodaqa.flow.MultiCASPipeline.runAnalysisEngines(MultiCASPipeline.java:135)\r\n\tat cz.brmlab.yodaqa.flow.MultiCASPipeline.runPipeline(MultiCASPipeline.java:95)\r\n\tat cz.brmlab.yodaqa.YodaQA_Web.main(YodaQA_Web.java:45)\r\nCaused by: java.util.concurrent.ExecutionException: org.apache.uima.analysis_engine.AnalysisEngineProcessException\r\n\tat java.util.concurrent.FutureTask.report(FutureTask.java:122)\r\n\tat java.util.concurrent.FutureTask.get(FutureTask.java:192)\r\n\tat cz.brmlab.yodaqa.flow.asb.MultiThreadASB$AggregateCasIterator.collectCasInFlow(MultiThreadASB.java:814)\r\n\tat cz.brmlab.yodaqa.flow.asb.MultiThreadASB$AggregateCasIterator.casInFlowFromFuture(MultiThreadASB.java:603)\r\n\tat cz.brmlab.yodaqa.flow.asb.MultiThreadASB$AggregateCasIterator.nextCasToProcess(MultiThreadASB.java:635)\r\n\tat cz.brmlab.yodaqa.flow.asb.MultiThreadASB$AggregateCasIterator.processUntilNextOutputCas(MultiThreadASB.java:1039)\r\n\t... 6 more\r\nCaused by: org.apache.uima.analysis_engine.AnalysisEngineProcessException\r\n\tat cz.brmlab.yodaqa.flow.asb.MultiThreadASB$AggregateCasIterator.processUntilNextOutputCas(MultiThreadASB.java:1074)\r\n\tat cz.brmlab.yodaqa.flow.asb.MultiThreadASB$AggregateCasIterator.<init>(MultiThreadASB.java:496)\r\n\tat cz.brmlab.yodaqa.flow.asb.MultiThreadASB.process(MultiThreadASB.java:416)\r\n\tat org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.processAndOutputNewCASes(AggregateAnalysisEngine_impl.java:266)\r\n\tat cz.brmlab.yodaqa.flow.asb.MultiThreadASB$AggregateCasIterator$1.call(MultiThreadASB.java:772)\r\n\tat cz.brmlab.yodaqa.flow.asb.MultiThreadASB$AggregateCasIterator$1.call(MultiThreadASB.java:754)\r\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:266)\r\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\r\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\r\n\tat java.lang.Thread.run(Thread.java:744)\r\nCaused by: java.util.ConcurrentModificationException\r\n\tat java.util.HashMap$HashIterator.nextNode(HashMap.java:1429)\r\n\tat java.util.HashMap$KeyIterator.next(HashMap.java:1453)\r\n\tat cz.brmlab.yodaqa.flow.asb.MultiThreadASB$AggregateCasIterator.nextCasToProcess(MultiThreadASB.java:711)\r\n\tat cz.brmlab.yodaqa.flow.asb.MultiThreadASB$AggregateCasIterator.processUntilNextOutputCas(MultiThreadASB.java:1039)\r\n\t... 9 more\r\n```"},"comment":{"url":"https://api.github.com/repos/brmson/yodaqa/issues/comments/163109741","html_url":"https://github.com/brmson/yodaqa/issues/23#issuecomment-163109741","issue_url":"https://api.github.com/repos/brmson/yodaqa/issues/23","id":163109741,"user":{"login":"zednis","id":1057295,"avatar_url":"https://avatars.githubusercontent.com/u/1057295?v=3","gravatar_id":"","url":"https://api.github.com/users/zednis","html_url":"https://github.com/zednis","followers_url":"https://api.github.com/users/zednis/followers","following_url":"https://api.github.com/users/zednis/following{/other_user}","gists_url":"https://api.github.com/users/zednis/gists{/gist_id}","starred_url":"https://api.github.com/users/zednis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zednis/subscriptions","organizations_url":"https://api.github.com/users/zednis/orgs","repos_url":"https://api.github.com/users/zednis/repos","events_url":"https://api.github.com/users/zednis/events{/privacy}","received_events_url":"https://api.github.com/users/zednis/received_events","type":"User","site_admin":false},"created_at":"2015-12-09T05:06:26Z","updated_at":"2015-12-09T05:06:26Z","body":"I found several small issues with by branch and after fixing them I am no longer getting exceptions and the application appears to be working normally.\r\n\r\nI am not 100% sure which of the bugs in my code were causing this issue, but I did resolve the following problems\r\n1. CAS Multiplier next( ) now returning empty JCas instead of null when there are no hits from ES\r\n2. \"empty answer\" CAS now correctly has AnswerInfo and ResultInfo being added to indexes\r\n3. Now using static index during next( ) processing like in SolrDocPrimarySearch"}}