Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dcache-bulk: fix warning for premature stop of job container
Motivation: On cancellation, it is possible to see: 08 Sep 2023 08:22:24 [pool-8-thread-19] [] Uncaught exception in thread pool-8-thread-19java.lang.RuntimeException: run container called with container in wrong state STOP; this is a bug. at org.dcache.services.bulk.job.AbstractRequestContainerJob.run(AbstractRequestContainerJob.java:330) at org.dcache.util.FireAndForgetTask.run(FireAndForgetTask.java:28) at org.dcache.util.CDCExecutorServiceDecorator$WrappedRunnable.run(CDCExecutorServiceDecorator.java:130) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:131) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:75) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:82) at org.dcache.util.BoundedExecutor$Worker.run(BoundedExecutor.java:247) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834) While this error would be appropriate for other states, it is possible to encounter a run `STOP` state upon (re)calling `run()` now that listing is multithreaded. Modification: Log the condition and exit. Result: Avoids stack traces which are not really from a bug but from a multithreaded cancel. Target: master Patch: https://rb.dcache.org/r/14093/ Requires-notes: no (unreleased change in https://rb.dcache.org/r/14041/) Ackec-by: Tigran
- Loading branch information