Skip to content

NPE when client try to add docs to a replica node #402

@frotsch

Description

@frotsch
[WARN ] 2021-11-11 14:12:34.761 [LuceneIndexingExecutor-1-thread-3] LuceneServer - error while trying to addDocuments
java.lang.NullPointerException: null
	at com.yelp.nrtsearch.server.luceneserver.AddDocumentHandler$DocumentIndexer.addDocuments(AddDocumentHandler.java:317) ~[nrtsearch-0.10.2.jar:?]
	at com.yelp.nrtsearch.server.luceneserver.AddDocumentHandler$DocumentIndexer.runIndexingJob(AddDocumentHandler.java:238) ~[nrtsearch-0.10.2.jar:?]
	at com.yelp.nrtsearch.server.grpc.LuceneServer$LuceneServerImpl$1.onCompletedForIndex(LuceneServer.java:651) ~[nrtsearch-0.10.2.jar:?]
	at com.yelp.nrtsearch.server.grpc.LuceneServer$LuceneServerImpl$1.lambda$onCompleted$0(LuceneServer.java:696) ~[nrtsearch-0.10.2.jar:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) [?:?]
	at java.lang.Thread.run(Thread.java:832) [?:?]

because shardState.writer is null on a replica node.

Instead of NPE the client should receive an error message like "Adding documents to an index on a replica mode is not supported".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions