Skip to content

DS-2036: Cancel job if client cancels connection.#1770

Open
mchrza wants to merge 3 commits intomasterfrom
DS-2036
Open

DS-2036: Cancel job if client cancels connection.#1770
mchrza wants to merge 3 commits intomasterfrom
DS-2036

Conversation

@mchrza
Copy link
Copy Markdown
Contributor

@mchrza mchrza commented Feb 27, 2026

No description provided.

Signed-off-by: mchrza <maximilian.chrzan@here.com>
@mchrza mchrza requested a review from a team as a code owner February 27, 2026 12:58
Signed-off-by: mchrza <maximilian.chrzan@here.com>
Comment thread xyz-jobs/xyz-job-service/src/main/java/com/here/xyz/jobs/service/JobApi.java Outdated
Comment thread xyz-jobs/xyz-job-service/src/main/java/com/here/xyz/jobs/service/JobApi.java Outdated
Signed-off-by: mchrza <maximilian.chrzan@here.com>
@mchrza mchrza requested a review from roegi February 27, 2026 14:58
.recover(t -> {
if(t instanceof HttpException e && e.status == HttpResponseStatus.GONE) {
logger.warn(getMarker(context), e.getMessage());
job.getStatus()
Copy link
Copy Markdown
Contributor

@mujammil10 mujammil10 Mar 2, 2026

Choose a reason for hiding this comment

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

Shouldn't we call job.cancel() here or inside the #abortIfClientGone ?

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.

In this case we cant provide a proper errorMessage.

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.

We will not be able to provide the error message anyway, coz the client closed the connection already.
Also, if we do not cancel the job, it will still be executing in the step function.

Copy link
Copy Markdown
Contributor

@roegi roegi left a comment

Choose a reason for hiding this comment

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

This has to wait to go in until #1554 was merged.

Also then we have to change this a bit to use a "CancellableFuture" to be used during the creation of the job. That would enable us to cancel the job while its creation / compilation / validation of the job is still ongoing. Now we would simply prevent to start the execution, but service resources would be blocked anyways.

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.

3 participants