Skip to content

Conversation

@DiegoTavares
Copy link
Collaborator

Adding requester information to JobKillRequest

This feature requires more information from job kill
actions requested through the API.

Link the Issue(s) this Pull Request is related to.
This feature is motivated by a situation where a script was misusing the API and calling kill on all the jobs for a show on a regular basis. Without this feature, finding where the requests were coming from was a big endeavor.

Summarize your change.
This change requires that a kill request also provide username, pid, host_kill and reason.

This feature requires more information from job kill
actions requested through the API.
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jun 11, 2024

CLA Not Signed

@DiegoTavares
Copy link
Collaborator Author

@roulaoregan-spi has already signed the CLA before, I'm ignoring the EasyCLA

Copy link
Collaborator

@ramonfigueiredo ramonfigueiredo left a comment

Choose a reason for hiding this comment

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

@DiegoTavares

Minor changes!

Thank you!


@Override
public void killFrames(LayerKillFramesRequest request, StreamObserver<LayerKillFramesResponse> responseObserver) {
updateLayer(request.getLayer());
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here:

@DiegoTavares

It is missing the if (attemptChange(env, property, jobManager, layer, responseObserver)) {

commit e7c38c6
PR: #1164

New code:

@Override
public void killFrames(LayerKillFramesRequest request, StreamObserver<LayerKillFramesResponse> responseObserver) {
    updateLayer(request.getLayer());
    if (attemptChange(env, property, jobManager, layer, responseObserver)) {
        manageQueue.execute(new DispatchKillFrames(frameSearch,
            new Source(request.toString(), request.getUsername(), request.getPid(),
                       request.getHostKill(), request.getReason()), jobManagerSupport));
        responseObserver.onNext(LayerKillFramesResponse.newBuilder().build());
        responseObserver.onCompleted();
    }
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

Return attemptChange calls that got removed by the merge

Signed-off-by: Diego Tavares <[email protected]>
@DiegoTavares
Copy link
Collaborator Author

@ramonfigueiredo thanks for the review. The proposed changes are in.

@ramonfigueiredo
Copy link
Collaborator

Thanks @DiegoTavares
Ready to merge!

@DiegoTavares DiegoTavares merged commit a314c6c into AcademySoftwareFoundation:master Jun 17, 2024
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