-
Couldn't load subscription status.
- Fork 2.3k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Hello.
We've analyzed Opensearch sources with SAST and it pointed out possible NPE in https://github.com/opensearch-project/OpenSearch/blob/main/server/src/main/java/org/opensearch/index/reindex/WorkerBulkByScrollTaskState.java#L299
Code
long remainingDelay = scheduled.getDelay(TimeUnit.NANOSECONDS);
// Actually reschedule the task
if (scheduled == null || false == scheduled.cancel()) {
// Couldn't cancel, probably because the task has finished or been scheduled. Either way we have nothing to do here.
logger.debug("[{}]: skipping rescheduling because we couldn't cancel the task", task.getId());
return this;
}
should throw NPE if sheduled is null.
Related component
No response
To Reproduce
Didn't catch it in action, just static analysis of the code
Expected behavior
No NPE if sheduled is null, need to swap blocks
Additional Details
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working