Skip to content

Introduce health-check-interval parameter for liveness probe#1850

Closed
IvanBorislavovDimitrov wants to merge 8 commits into
masterfrom
feature/LMCROSSITXSADEPLOY-3316
Closed

Introduce health-check-interval parameter for liveness probe#1850
IvanBorislavovDimitrov wants to merge 8 commits into
masterfrom
feature/LMCROSSITXSADEPLOY-3316

Conversation

@IvanBorislavovDimitrov
Copy link
Copy Markdown
Contributor

Summary

Adds support for the health-check-interval MTA module parameter, bringing feature parity with native Cloud Foundry. Application descriptors can now configure the interval (in seconds) between liveness health-check probes.

modules:
  - name: my-app
    type: application
    parameters:
      health-check-interval: 15

The parameter was previously not exposable through MTA because the underlying CF Java client did not surface it; recent client versions do, so this change wires it through the controller.

What changed

multiapps-controller-client

  • Staging and HealthCheckInfo carry the new healthCheckInterval field.
  • RawCloudProcess round-trips the field when adapting the CF client's Process resource.
  • CloudControllerRestClientImpl forwards the value to the CF Java client when staging an app.

multiapps-controller-core

  • SupportedParameters registers health-check-interval so it is recognised at parse time.
  • StagingParametersParser reads the parameter and rejects non-positive values.

multiapps-controller-process

  • AdditionalModuleParametersReporter includes the parameter in usage telemetry.
  • Drift detection in CreateOrUpdateAppStep now triggers an update when the interval changes.

Tests

File Cases Notes
RawCloudProcessTest 3 round-trip of liveness interval
HealthCheckInfoTest 8 covers boundaries and defaults
StagingParametersParserTest +2 non-positive rejection, boundary
AdditionalModuleParametersReporterTest 2 reporting on/off paths
CreateOrUpdateStepWithExistingAppTest +2 drift detection when interval changes

Verified locally with:

mvn -pl multiapps-controller-client,multiapps-controller-core,multiapps-controller-process -am test \
    -Dtest=RawCloudProcessTest,HealthCheckInfoTest,StagingParametersParserTest,AdditionalModuleParametersReporterTest,CreateOrUpdateStepWithExistingAppTest \
    -Dsurefire.failIfNoSpecifiedTests=false

Tracking

JIRA:LMCROSSITXSADEPLOY-3316

Surface a new MTA module parameter `health-check-interval` (Integer,
seconds) that controls the liveness health-check interval for a CF
application. Mirrors the existing `readiness-health-check-interval`
end-to-end:

- New SupportedParameters constant registered in MODULE_PARAMETERS.
- StagingParametersParser reads the value and forwards it through the
  ImmutableStaging builder.
- Staging interface and CloudProcess gain a getHealthCheckInterval()
  accessor; Immutables regenerates the builders.
- CloudControllerRestClientImpl.buildHealthCheck forwards the value
  via Data.builder().interval(...) so the CF API call carries it.
- RawCloudProcess populates the new field from
  healthCheckData.getInterval() so updates round-trip correctly.
- HealthCheckInfo carries the new field so
  StagingApplicationAttributeUpdater detects redeploys that change
  only the liveness interval.
- Parser unit tests cover both present and absent cases.

Behaviour is fully additive: omitting the parameter is byte-for-byte
identical to the pre-change baseline.

JIRA:LMCROSSITXSADEPLOY-3316
Extend the existing parameterized drift-detection test with two rows
that exercise the new liveness interval field: one where the value
changes between existing and new staging (should trigger an update)
and one where it matches (should not). Plumb the value through
prepareClient so the mocked getApplicationProcess echoes the
configured interval back.

JIRA:LMCROSSITXSADEPLOY-3316
Cover the new RawCloudProcess#derive branch that copies the liveness
health check interval from the cf-java-client Data into the derived
CloudProcess. Three cases: explicit interval is propagated, absent
interval surfaces as null, and a HealthCheck with null Data does not
NPE and yields a null interval.

JIRA:LMCROSSITXSADEPLOY-3316
Adds an explicit guard in StagingParametersParser that throws a
ContentException with a clear message when health-check-interval is
zero or negative, plus tests covering both rejection cases.

JIRA:LMCROSSITXSADEPLOY-3316
Adds a boundary case for health-check-interval=1 to lock in the
inclusive-zero exclusion enforced by StagingParametersParser.

JIRA:LMCROSSITXSADEPLOY-3316
Remove the parser-side rejection of zero/negative health-check-interval
values to keep parity with healthCheckTimeout and readinessHealthCheckInterval,
which forward any non-null Integer to the Cloud Controller without
validation. The CF Java client and Cloud Controller remain the source of
truth for value validity.

JIRA:LMCROSSITXSADEPLOY-3316
Extend AdditionalModuleParametersReporter to log a separate line when a
module specifies the new health-check-interval (liveness) parameter.
The existing readiness log line is left untouched because it is observed
by Dynatrace.

Add a package-private constructor that accepts a Logger so the new
liveness branch is verifiable in unit tests; the public constructor
delegates to it with the static SLF4J logger.

JIRA:LMCROSSITXSADEPLOY-3316
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 1, 2026

@IvanBorislavovDimitrov IvanBorislavovDimitrov deleted the feature/LMCROSSITXSADEPLOY-3316 branch June 1, 2026 12:03
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.

1 participant