DeadlineAlertWatch will continue to work after the project is deleted

Hello. 

How to reproduce:

- Create a project and setup "Default review deadline"

- Remove the project

- After some time in log, I found next errors: Error while processing 'DeadlineAlertWatch' events for project 'my_project' 

Upsource Version: Build 2018.1.357

Call Stack:

[2019-06-04 08:23:46,104] ERROR coroutine#1678714241 server.watching.WatchesHandler - Error while processing 'DeadlineAlertWatch' events for project 'my_project'
com.jetbrains.upsource.backend.server.core.db.ProjectNotFoundException: Project 'my_project' not found
at com.jetbrains.upsource.backend.server.core.db.SystemDatabase.getProjectRecord(SystemDatabase.java:262)
at com.jetbrains.upsource.backend.server.core.db.ProjectHolder.a(ProjectHolder.kt:103)
at com.jetbrains.upsource.backend.server.core.db.ProjectHolder.withAsync(ProjectHolder.kt:78)
at com.jetbrains.upsource.backend.server.watching.WatchesHandler.handleProjectWatches(WatchesHandler.kt:155)
at com.jetbrains.upsource.backend.server.watching.WatchesHandler.handleWatches(WatchesHandler.kt:93)
at com.jetbrains.upsource.backend.server.watching.WatchesHandler$1$1.doResume(WatchesHandler.kt:46)
at kotlin.coroutines.experimental.jvm.internal.CoroutineImpl.resume(CoroutineImpl.kt:54)
at kotlinx.coroutines.experimental.DispatchTask.run(CoroutineDispatcher.kt:123)
at kotlinx.coroutines.experimental.EventLoopBase$QueuedRunnableTask.run(EventLoop.kt:189)
at kotlinx.coroutines.experimental.EventLoopBase.processNextEvent(EventLoop.kt:129)
at kotlinx.coroutines.experimental.BlockingCoroutine.joinBlocking(Builders.kt:227)
at kotlinx.coroutines.experimental.BuildersKt.runBlocking(Builders.kt:165)
at kotlinx.coroutines.experimental.BuildersKt.runBlocking$default(Builders.kt:158)
at com.jetbrains.upsource.backend.server.watching.WatchesHandler$1.run(WatchesHandler.kt:45)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at com.jetbrains.upsource.util.NamedDaemonThreadFactory.a(NamedDaemonThreadFactory.java:34)
at java.lang.Thread.run(Thread.java:748)

Please sign in to leave a comment.