The ScheduledCommitPolicy might open unnecessary IndexWriter instances to check if it needs flushing, and in a rare race condition with the shutdown process it might hit an NPE to perform this check.