Skip to content

Commit

Permalink
Rename configuration properties and add defauts the nflow-engine.prop…
Browse files Browse the repository at this point in the history
…erties
  • Loading branch information
gmokki authored and Edvard Fonsell committed Jan 23, 2020
1 parent 6569116 commit 5eed7d8
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
- Fix honoring of `includeCurrentStateVariables` flag in `WorkflowInstanceService.listWorkflowInstances`. This caused major slowness when using bulk workflows.
To preserve the existing (incorrect) default behaviour in backwards compatible way the default value in `QueryWorkflowInstances.Builder` is changed to `true`. The REST API is unaffected.
Especially in workflows with many children that use the `StateExecution.getAllChildWorkflows` method the performance impact can be high. Before 7.0.0 release, it is recommended to use `StateExecution.queryChildWorkflows(new QueryWorkflowInstances.Builder().setIncludeCurrentStateVariables(false).build())` if state variables are not needed.
- Improve child workflow final state execution speed by caching the parent workflow type. Use `nflow.db.type.cache.size` property to tune the size.
- Improve child workflow final state execution speed by caching the parent workflow type. Use `nflow.db.workflowInstanceType.cacheSize` property to tune the size.
- Optional performance improvement to state execution by not scanning for child workflows instances. If access to child workflow instances is needed, they can be fetched using `StateExecution.getChildWorklfow` methods. To enable set the property `nflow.executor.fetchChildWorkflowIds` to `false`, which is recommended for all. The default functionality will change in next major release.
- Dependency updates:
- jetty 9.4.25.v20191220
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,11 @@ public WorkflowInstanceDao(SQLVariants sqlVariants, @NFlow JdbcTemplate nflowJdb
if (disableBatchUpdates) {
logger.info("nFlow DB batch updates are disabled (system property nflow.db.disable_batch_updates=true)");
}
workflowInstanceTypeCacheSize = env.getRequiredProperty("nflow.db.workflowInstanceType.cacheSize", Integer.class);
// In one deployment, FirstColumnLengthExtractor returned 0 column length (H2), so allow explicit length setting.
instanceStateTextLength = env.getProperty("nflow.workflow.instance.state.text.length", Integer.class, -1);
actionStateTextLength = env.getProperty("nflow.workflow.action.state.text.length", Integer.class, -1);
stateVariableValueMaxLength = env.getProperty("nflow.workflow.state.variable.value.length", Integer.class, -1);
workflowInstanceTypeCacheSize = env.getProperty("nflow.db.type.cache.size", Integer.class, 10_000);
}

private int getInstanceStateTextLength() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class WorkflowStateProcessor implements Runnable {
stateVariableValueTooLongRetryDelay = env.getRequiredProperty("nflow.executor.stateVariableValueTooLongRetryDelay.minutes",
Integer.class);
// TODO remove flag in 7.x release and default to not fetching child ids (or alternatively, let each step of WorkflowDefinition override what information needs to be fetched)
fetchChildWorkflowIds = env.getProperty("nflow.executor.fetchChildWorkflowIds", Boolean.class, true);
fetchChildWorkflowIds = env.getRequiredProperty("nflow.executor.fetchChildWorkflowIds", Boolean.class);
}

@Override
Expand Down
3 changes: 2 additions & 1 deletion nflow-engine/src/main/resources/nflow-engine.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ nflow.executor.stuckThreadThreshold.seconds=60
nflow.executor.stateProcessingRetryDelay.seconds=60
nflow.executor.stateSaveRetryDelay.seconds=60
nflow.executor.stateVariableValueTooLongRetryDelay.minutes=60
nflow.executor.fetchChildWorkflowIds=true

nflow.dispatcher.sleep.ms=1000
nflow.dispatcher.await.termination.seconds=60
Expand Down Expand Up @@ -65,6 +66,6 @@ nflow.db.max_pool_size=4
nflow.db.idle_timeout_seconds=600
nflow.db.create_on_startup=true
nflow.db.disable_batch_updates=false
nflow.db.type.cache.size=10000
nflow.db.workflowInstanceType.cacheSize=10000

nflow.definition.persist=true

0 comments on commit 5eed7d8

Please sign in to comment.