NPE, integrity constraint violation, and timers firing after task completion on processes with certain combinations of timers, messages, and user tasks

Description

For process definitions with certain combinations of periodic timers and messages, jobs are not removed from the DB and are subsequently tied to an execution representing the wrong activity in the process. Alternatively, the jobs are left in the DB and fail by throwing an NPE due to the Execution having already been removed from the DB.

In the former case, the timers continue to fire throughout the lifetime of the process even though the activity that spawned the timer has been completed. In the latter case, the logs are littered with exceptions (3 per job), but at least the timers stop firing after the retries are exhausted.

Pull request URL and further details regarding the pull request will be provided in the comments.

Environment

Postgres, OSX, Debian

Assignee

Tijs Rademakers

Reporter

David Valeri

Labels

None

Components

Fix versions

Affects versions

Priority

Major
Configure