Skip to content

sch-UID2-6637 add conditional defaulting for service instance count#2413

Merged
sophia-chen-ttd merged 1 commit into
mainfrom
sch-UID2-6637-conditional-defaulting-for-service-instance-count
Mar 4, 2026
Merged

sch-UID2-6637 add conditional defaulting for service instance count#2413
sophia-chen-ttd merged 1 commit into
mainfrom
sch-UID2-6637-conditional-defaulting-for-service-instance-count

Conversation

@sophia-chen-ttd

@sophia-chen-ttd sophia-chen-ttd commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

If service_instance count does not exist in the config or is null, then default to the vCPU count.

Tested locally:

  • "service_instance": null -> default vCPU count used
  • "service_instance": 1 -> 1 service instance used
  • no service_instance key -> default vCPU count used

if (svcInstances == null) {
svcInstances = Runtime.getRuntime().availableProcessors();
}
requestedServiceInstances = svcInstances;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Can we dorequestedServiceInstances = config.getInteger(Const.Config.ServiceInstancesProp, Runtime.getRuntime().availableProcessors());

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't because if we have "service_instance": null, then this will still pick up the value as null :(
The default value is only used if the key doesn't exist

@sophia-chen-ttd sophia-chen-ttd merged commit 3672b68 into main Mar 4, 2026
9 checks passed
@sophia-chen-ttd sophia-chen-ttd deleted the sch-UID2-6637-conditional-defaulting-for-service-instance-count branch March 4, 2026 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants