Skip to content

Migration of the cf-java-client dependency - #1907

Open
karrgov wants to merge 23 commits into
masterfrom
cf_java_client_poc
Open

karrgov wants to merge 23 commits into
masterfrom
cf_java_client_poc

Conversation

@karrgov

@karrgov karrgov commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Migration of the cf-java-client dependency

@theghost5800 theghost5800 left a comment

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.

Some of comments are repeatable or not but overall do the checks through all the code again if possible

Comment thread multiapps-controller-client/pom.xml Resolved
Comment thread multiapps-controller-client/pom.xml Resolved
Comment thread pom.xml Resolved

@theghost5800 theghost5800 left a comment

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.

Some of comments are repeatable or not but overall do the checks through all the code again if possible

@karrgov
karrgov force-pushed the cf_java_client_poc branch from 19c69f8 to e7fa4e6 Compare October 13, 2026 05:37
Duration interval = Constants.JOB_POLL_MIN_INTERVAL;

while (true) {
V3Job asyncJob = get(CloudControllerV3Endpoints.JOBS + jobGuid, V3Job.class);

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.

I don't see this changed, I expect to use similar structures as this method postForObject(String uri, Object body, Class<T> responseType, Object... uriVars). jobGuid to be passed as uriVar, not as concatenated String.

long timeoutNanos = timeout.toNanos();
Duration interval = Constants.JOB_POLL_MIN_INTERVAL;

while (true) {

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.

while (asyncJob == null || !asyncJob.isTerminal()) {
        long elapsedNanos = determineElapsedTime(startTimeNanos, timeout, jobGuid);
        long remainingNanos = timeoutNanos - elapsedNanos;

        Duration sleepDuration = interval.toNanos() > remainingNanos ? Duration.ofNanos(remainingNanos) : interval;
        sleep(sleepDuration);

        interval = nextInterval(interval);
        asyncJob = get(CloudControllerV3Endpoints.JOBS + jobGuid, V3Job.class);
    }

    if (asyncJob.isFailed()) {
        throw jobFailed(asyncJob);
    }
    return asyncJob;

Here is one solution which can avoid this.

Also I have notice in the current behaviour that there is no exit from the loop due to exceeded timeout which means if job doesn't return any success or failed state in expected timeout frame, then it will stuck indefinitely.

Comment thread pom.xml Resolved
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
78.2% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

This branch has not been deployed

No deployments
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.

5 participants