Introduction
Internally, a scheduled or running task is represented by the Mendix entity System.QueuedTask. This table should never be empty. This entity/table should not be modified directly by custom code because the underlying database table is heavily used.
Environment
Applications hosted in any deployment type.
Details
At a minimum, the System.QueuedTask table should contain the cluster management tasks, as well as any application scheduled events. It should never be empty or modified by a microflow or custom code. As this table is heavily used, customizations to it might cause a serious slowdown in task processing. Additionally, the database sync, which is executed when an application is started, is only run when a model change is detected.
There are two things that will be synchronized into the System.QueuedTask table independently:
- The Mendix runtime’s own cluster management tasks will be synchronized whenever a model change is detected. Without a model change, the Mendix runtime assumes that the cluster management tasks from the previous deployment still exist.
- The application's scheduled events will be synchronized whenever the scheduled events runtime settings are changed, or a model change is detected.
As a result, if the System.QueuedTask table is manually modified or cleared, scheduled events will not run after an application restart. This is because a restart denotes no model changes, so the database sync assumes the System.QueuedTask table is the same from last time and resumes from there. Since the System.QueuedTask is now empty or modified in this scenario, some or all of the impacted scheduled events cannot resume.
Therefore, it is important that the System.QueuedTask table is not manually emptied or modified by a microflow or custom code. If the table is cleared, and the scheduled events are not running, a deployment with a model change is required. A model change is defined by a change in the deployment id, which Studio Pro generates. If the app is changed in Studio Pro, a new deployment id is set. This triggers the System.QueuedTask table to be recreated on startup, which sets the scheduled events in motion again.
Internal information related
- 292123
- C3T260XGA/p1794319304532759
Additional information
Mendix documentation: Task Queues
0 Comments