Skip to content

Commit

Permalink
Merge pull request #5696 from breakponchito/FISH-5966-fixing-async-is…
Browse files Browse the repository at this point in the history
…sue-managedexecutors

FISH-5966: adding fix for maxasync configuration for executors
  • Loading branch information
breakponchito committed Apr 6, 2022
2 parents cf39de0 + 7b5a22b commit 8f159a4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,17 @@ public ManagedExecutorDefinitionDescriptor createDescriptor(ManagedExecutorDefin
ManagedExecutorDefinitionDescriptor medd = new ManagedExecutorDefinitionDescriptor();
medd.setName(TranslatedConfigView.expandValue(managedExecutorDefinition.name()));
medd.setContext(TranslatedConfigView.expandValue(managedExecutorDefinition.context()));
// FIXME: cdd.setContextInfo(??? Load from existing ContextServiceDefinition!);

if(managedExecutorDefinition.hungTaskThreshold() < 0) {
medd.setHungAfterSeconds(0);
} else {
medd.setHungAfterSeconds(managedExecutorDefinition.hungTaskThreshold());
}

if(managedExecutorDefinition.maxAsync() < 0) {
medd.setMaximumPoolSize(Integer.MAX_VALUE);
} else {
medd.setMaximumPoolSize(managedExecutorDefinition.maxAsync());
}

medd.setMetadataSource(MetadataSource.ANNOTATION);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,14 @@ public ManagedScheduledExecutorDefinitionDescriptor createDescriptor(ManagedSche

if(managedScheduledExecutorDefinition.hungTaskThreshold() < 0) {
msedd.setHungTaskThreshold(0);
} else {
msedd.setHungTaskThreshold(managedScheduledExecutorDefinition.hungTaskThreshold());
}

if(managedScheduledExecutorDefinition.maxAsync() < 0) {
msedd.setMaxAsync(Integer.MAX_VALUE);
} else {
msedd.setMaxAsync(managedScheduledExecutorDefinition.maxAsync());
}

msedd.setMetadataSource(MetadataSource.ANNOTATION);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ protected Map getDispatchTable() {
table.put(TagNames.MANAGED_EXECUTOR_NAME, "setName");
table.put(TagNames.MANAGED_EXECUTOR_MAX_ASYNC, "setMaximumPoolSize");
table.put(TagNames.MANAGED_EXECUTOR_HUNG_TASK_THRESHOLD, "setHungAfterSeconds");
table.put(TagNames.MANAGED_EXECUTOR_CONTEXT_SERVICE_REF, "setContextInfo");
table.put(TagNames.MANAGED_EXECUTOR_CONTEXT_SERVICE_REF, "setContext");
return table;
}

Expand Down

0 comments on commit 8f159a4

Please sign in to comment.