Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
master, 3.1.0
-
None
Description
We miss a null check on mailRepository.retrieve(key)
This can happen for instance in the face of concurrent deletes
11:56:43.579 [ERROR] o.a.j.t.MemoryTaskManager - Error while running task java.lang.NullPointerException: null at org.apache.james.webadmin.service.ReprocessingService.reprocess(ReprocessingService.java:72) at org.apache.james.webadmin.service.ReprocessingService.lambda$null$0(ReprocessingService.java:59) at com.github.fge.lambdas.consumers.ConsumerChainer.doAccept(ConsumerChainer.java:20) at com.github.fge.lambdas.consumers.ThrowingConsumer.accept(ThrowingConsumer.java:22) at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) at java.util.stream.ReferencePipeline$11$1.accept(ReferencePipeline.java:373) at java.util.Iterator.forEachRemaining(Iterator.java:116) at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418) at org.apache.james.webadmin.service.ReprocessingService.lambda$reprocessAll$1(ReprocessingService.java:59) at com.github.fge.lambdas.consumers.ConsumerChainer.lambda$sneakyThrow$9(ConsumerChainer.java:73) at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382) at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580) at org.apache.james.webadmin.service.ReprocessingService.reprocessAll(ReprocessingService.java:56) at org.apache.james.webadmin.service.ReprocessingAllMailsTask.run(ReprocessingAllMailsTask.java:99) at org.apache.james.task.MemoryTaskManager.run(MemoryTaskManager.java:84) at org.apache.james.task.MemoryTaskManager.lambda$runWithMdc$2(MemoryTaskManager.java:77) at org.apache.james.util.MDCBuilder.lambda$withMdc$0(MDCBuilder.java:60) at org.apache.james.util.MDCBuilder.withMdc(MDCBuilder.java:48) at org.apache.james.util.MDCBuilder.withMdc(MDCBuilder.java:59) at org.apache.james.task.MemoryTaskManager.runWithMdc(MemoryTaskManager.java:72) at org.apache.james.task.MemoryTaskManager.lambda$submit$1(MemoryTaskManager.java:67) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)