RejectedExecutionException when signing out
I got the following crash when signing out:
java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@1e487d9c rejected from java.util.concurrent.ScheduledThreadPoolExecutor@3dcb33a5[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 2]
at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2011)
at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:793)
at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(ScheduledThreadPoolExecutor.java:298)
at java.util.concurrent.ScheduledThreadPoolExecutor.schedule(ScheduledThreadPoolExecutor.java:503)
at java.util.concurrent.Executors$DelegatedScheduledExecutorService.schedule(Executors.java:644)
at org.briarproject.bramble.plugin.Poller.schedule(Poller.java:166)
at org.briarproject.bramble.plugin.Poller.reschedule(Poller.java:145)
at org.briarproject.bramble.plugin.Poller.eventOccurred(Poller.java:85)
at org.briarproject.bramble.event.EventBusImpl.broadcast(EventBusImpl.java:32)
at org.briarproject.bramble.plugin.ConnectionRegistryImpl.unregisterConnection(ConnectionRegistryImpl.java:94)
at org.briarproject.bramble.plugin.ConnectionManagerImpl$ManageOutgoingDuplexConnection.runIncomingSession(ConnectionManagerImpl.java:404)
at org.briarproject.bramble.plugin.ConnectionManagerImpl$ManageOutgoingDuplexConnection.bridge$lambda$0$ConnectionManagerImpl$ManageOutgoingDuplexConnection(ConnectionManagerImpl.java)
at org.briarproject.bramble.plugin.ConnectionManagerImpl$ManageOutgoingDuplexConnection$$Lambda$0.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
Looks like unregistering a connection caused the poller to reschedule polling, which crashed because the ScheduledExecutorService had already been shut down. Our other executors are configure to discard jobs submitted after shutdown, but the ScheduledExecutorService seems to be using the default policy of throwing an exception.