@sgiehl opened this Issue on August 9th 2021 Member

Currently a scheduled task can be triggered multiple times in parallel. As this can cause serious issues for tasks that manipulate data, we should provide some kind of concurrency lock for scheduled tasks to prevent that by default.

Simplest solution might be to create a Concurrency/Lock for each Task that is running. We could maybe use a default TTL of one hour, but allow each task to provide a custom TTL for that, so a longer running task can define a longer one.
This approach for sure wouldn't prevent concurrency for tasks that might run longer than the defined TTL. But it would at least prevent tasks being triggered multiple times.

To really avoid concurrency guess we would need to implement a more complex solution that really checks if a Task might be running in another process, but that might not be needed for now.

Note: there should also be a possibility to allow a task to be executed in parallel (maybe by setting the TTL to null or 0)

Powered by GitHub Issue Mirror