Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArrayIndexOutOfBoundsException in CollectionMetric.getValueAndReset() #555

Closed
jnioche opened this issue Mar 28, 2018 · 0 comments
Closed
Labels
Milestone

Comments

@jnioche
Copy link
Contributor

jnioche commented Mar 28, 2018

Caused by: java.lang.ArrayIndexOutOfBoundsException: 9
	at java.util.LinkedList.toArray(LinkedList.java:1053) ~[?:1.8.0_161]
	at java.util.LinkedList.addAll(LinkedList.java:408) ~[?:1.8.0_161]
	at java.util.LinkedList.addAll(LinkedList.java:387) ~[?:1.8.0_161]
	at java.util.LinkedList.<init>(LinkedList.java:119) ~[?:1.8.0_161]
	at com.digitalpebble.stormcrawler.util.CollectionMetric.getValueAndReset(CollectionMetric.java:35) ~[stormjar.jar:?]
	at org.apache.storm.daemon.executor$metrics_tick$fn__4899.invoke(executor.clj:345) ~[storm-core-1.2.1.jar:1.2.1]
	at clojure.core$map$fn__4553.invoke(core.clj:2622) ~[clojure-1.7.0.jar:?]

https://github.com/DigitalPebble/storm-crawler/blob/ce9134612bbfbf500adba6a89477b2597181d241/core/src/main/java/com/digitalpebble/stormcrawler/util/CollectionMetric.java#L35

The metric object is used by https://github.com/DigitalPebble/storm-crawler/blob/f6d51debfd2a5897015c388ee931b21570ea1f52/external/elasticsearch/src/main/java/com/digitalpebble/stormcrawler/elasticsearch/persistence/AbstractSpout.java#L146

My guess is that the spout instance is trying to add the list while it is being copied. We could simply add synchronized blocks to prevent concurrent access to the list.

@jnioche jnioche added the bug label Mar 28, 2018
@jnioche jnioche added this to the 1.9 milestone Mar 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant