Skip to content

Commit

Permalink
Force updating the job status to KILLED when killing a job that has a…
Browse files Browse the repository at this point in the history
… connected agent but no response observer
  • Loading branch information
bhou committed Oct 24, 2023
1 parent 082212c commit 9c012bb
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,6 @@ public void killJob(
JobStatus.KILLED
);
throw new GenieJobNotFoundException(e);
} catch (final Exception e) {
log.error(
"Failed to force updating the status of Job {} to {} due to unexpected exceptions",
jobId,
JobStatus.KILLED
);
throw e;
}
} else {
responseObserver.onNext(JobKillRegistrationResponse.newBuilder().build());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,19 +182,6 @@ class GRpcJobKillServiceImplSpec extends Specification {
0 * this.responseObserver.onCompleted()
thrown(GenieJobNotFoundException)

when: "The job is active, the agent is connected, the job is local but no observer, and updating job status fails"
this.serviceSpy.killJob(this.jobId, this.reason, this.servletRequest)

then: "The database is not updated and exception is thrown"
1 * this.persistenceService.getJobStatus(this.jobId) >> JobStatus.CLAIMED
1 * this.persistenceService.updateJobStatus(this.jobId, JobStatus.CLAIMED, JobStatus.KILLED, this.reason) >> {
throw new Exception()
}
1 * this.agentRoutingService.isAgentConnectionLocal(this.jobId) >> true
0 * this.responseObserver.onNext(_ as JobKillRegistrationResponse)
0 * this.responseObserver.onCompleted()
thrown(Exception)

when: "The job is active, the agent is connected, and there is an observer"
this.serviceSpy.registerForKillNotification(this.request, this.responseObserver)
this.serviceSpy.killJob(this.jobId, this.reason, null)
Expand Down

0 comments on commit 9c012bb

Please sign in to comment.