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

Fix possible NPE in InternalClusterService$NotifyTimeout, the future field is set from a different thread #10630

Merged
merged 1 commit into from Apr 17, 2015

Conversation

martijnvg
Copy link
Member

This is likely cause of the following failure: http://build-us-00.elastic.co/job/es_g1gc_1x_metal/7976/

REPRODUCE WITH  : mvn clean test -Dtests.seed=CD6728614E507BB9 -Dtests.class=org.elasticsearch.search.basic.SearchWithRandomExceptionsTests -Dtests.method="testRandomDirectoryIOExceptions" -Des.logger.level=DEBUG -Des.node.mode=local -Dtests.security.manager=false -Dtests.nightly=false -Dtests.heap.size=512m -Dtests.jvm.argline="-server -XX:+UseG1GC -XX:-UseCompressedOops -XX:+AggressiveOpts" -Dtests.locale=pl -Dtests.timezone=Pacific/Johnston -Dtests.processors=8
  1> Throwable:
  1> com.carrotsearch.randomizedtesting.UncaughtExceptionError: Captured an uncaught exception in thread: Thread[id=4658, name=elasticsearch[node_s4][generic][T#3], state=RUNNABLE, group=TGRP-SearchWithRandomExceptionsTests]
  1>     __randomizedtesting.SeedInfo.seed([CD6728614E507BB9:849B444950169018]:0)
  1> Caused by: java.lang.NullPointerException
  1>     __randomizedtesting.SeedInfo.seed([CD6728614E507BB9]:0)
  1>     org.elasticsearch.cluster.service.InternalClusterService$NotifyTimeout.run(InternalClusterService.java:532)
  1>     java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
  1>     java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
  1>     java.lang.Thread.run(Thread.java:745)

@bleskes
Copy link
Contributor

bleskes commented Apr 16, 2015

I think we also need a null protection at if (future.isCancelled()) { .

@martijnvg
Copy link
Member Author

@bleskes I added the null check.

@bleskes
Copy link
Contributor

bleskes commented Apr 16, 2015

LGTM. I think this can go to 1.5 too.

martijnvg added a commit to martijnvg/elasticsearch that referenced this pull request Apr 17, 2015
@martijnvg martijnvg merged commit 161e740 into elastic:master Apr 17, 2015
@martijnvg martijnvg deleted the cluster_service/NPE branch May 18, 2015 23:25
mute pushed a commit to mute/elasticsearch that referenced this pull request Jul 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants