diff --git a/bootstrap/sql/migrations/native/1.10.0/mysql/schemaChanges.sql b/bootstrap/sql/migrations/native/1.10.0/mysql/schemaChanges.sql index 21f6594d22b..98881c55b8f 100644 --- a/bootstrap/sql/migrations/native/1.10.0/mysql/schemaChanges.sql +++ b/bootstrap/sql/migrations/native/1.10.0/mysql/schemaChanges.sql @@ -18,4 +18,14 @@ WHERE configType = 'entityRulesSettings' JSON_QUOTE('Data Product Domain Validation') ); -- Increase Flowable ACTIVITY_ID_ column size to support longer user-defined workflow node names -ALTER TABLE ACT_RU_EVENT_SUBSCR MODIFY ACTIVITY_ID_ varchar(255); \ No newline at end of file +ALTER TABLE ACT_RU_EVENT_SUBSCR MODIFY ACTIVITY_ID_ varchar(255); + +-- Update workflow settings with new job acquisition interval settings +UPDATE openmetadata_settings +SET json = JSON_SET( + json, + '$.executorConfiguration.asyncJobAcquisitionInterval', 60000, + '$.executorConfiguration.timerJobAcquisitionInterval', 60000 +) +WHERE configType = 'workflowSettings' + AND JSON_EXTRACT(json, '$.executorConfiguration') IS NOT NULL; \ No newline at end of file diff --git a/bootstrap/sql/migrations/native/1.10.0/postgres/schemaChanges.sql b/bootstrap/sql/migrations/native/1.10.0/postgres/schemaChanges.sql index d4a2b4edd0e..466321ee949 100644 --- a/bootstrap/sql/migrations/native/1.10.0/postgres/schemaChanges.sql +++ b/bootstrap/sql/migrations/native/1.10.0/postgres/schemaChanges.sql @@ -20,4 +20,20 @@ WHERE configtype = 'entityRulesSettings' WHERE rule->>'name' = 'Data Product Domain Validation' ); -- Increase Flowable ACTIVITY_ID_ column size to support longer user-defined workflow node names -ALTER TABLE ACT_RU_EVENT_SUBSCR ALTER COLUMN ACTIVITY_ID_ TYPE varchar(255); \ No newline at end of file +ALTER TABLE ACT_RU_EVENT_SUBSCR ALTER COLUMN ACTIVITY_ID_ TYPE varchar(255); + +-- Update workflow settings with new job acquisition interval settings +UPDATE openmetadata_settings +SET json = jsonb_set( + jsonb_set( + json, + '{executorConfiguration,asyncJobAcquisitionInterval}', + '60000', + true + ), + '{executorConfiguration,timerJobAcquisitionInterval}', + '60000', + true +) +WHERE configtype = 'workflowSettings' + AND json->'executorConfiguration' IS NOT NULL; \ No newline at end of file diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/WorkflowHandler.java b/openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/WorkflowHandler.java index f6ce61b4dad..27341af9802 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/WorkflowHandler.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/WorkflowHandler.java @@ -123,7 +123,11 @@ public class WorkflowHandler { .setAsyncExecutorAsyncJobLockTimeInMillis( workflowSettings.getExecutorConfiguration().getJobLockTimeInMillis()) .setAsyncExecutorMaxAsyncJobsDuePerAcquisition( - workflowSettings.getExecutorConfiguration().getTasksDuePerAcquisition()); + workflowSettings.getExecutorConfiguration().getTasksDuePerAcquisition()) + .setAsyncExecutorDefaultAsyncJobAcquireWaitTime( + workflowSettings.getExecutorConfiguration().getAsyncJobAcquisitionInterval()) + .setAsyncExecutorDefaultTimerJobAcquireWaitTime( + workflowSettings.getExecutorConfiguration().getTimerJobAcquisitionInterval()); // Setting History CleanUp processEngineConfiguration diff --git a/openmetadata-spec/src/main/resources/json/schema/configuration/workflowSettings.json b/openmetadata-spec/src/main/resources/json/schema/configuration/workflowSettings.json index 3eec22751ba..18b71526ef2 100644 --- a/openmetadata-spec/src/main/resources/json/schema/configuration/workflowSettings.json +++ b/openmetadata-spec/src/main/resources/json/schema/configuration/workflowSettings.json @@ -33,6 +33,16 @@ "type": "integer", "default": 1296000000, "description": "The amount of time a Job gets locked before being retried. Default: 15 Days. This avoids jobs that takes too long to run being retried while running." + }, + "asyncJobAcquisitionInterval": { + "type": "integer", + "default": 60000, + "description": "The interval in milliseconds to acquire async jobs. Default: 60 seconds. This controls how often Flowable polls for new jobs." + }, + "timerJobAcquisitionInterval": { + "type": "integer", + "default": 60000, + "description": "The interval in milliseconds to acquire timer jobs. Default: 60 seconds. This controls how often Flowable polls for scheduled jobs." } }, "additionalProperties": false