Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.0] Proper handling of waiting jobs when set to be killed #7690

Open
wants to merge 1 commit into
base: rel-v8r0
Choose a base branch
from

Conversation

michmx
Copy link

@michmx michmx commented Jun 24, 2024

When jobs are in status SUBMITTING, WAITING, etc, and they are set to be killed, they are not added to the list markKilledJobList. This pull request fix the identation when kill instead of delete is used.

BEGINRELEASENOTES

*WMS
FIX: Proper killing of jobs when not matched, running or stalled

ENDRELEASENOTES

@DIRACGridBot DIRACGridBot added the alsoTargeting:integration Cherry pick this PR to integration after merge label Jun 24, 2024
@michmx michmx changed the title fix(wms): proper handling of markKilledJobList when killing jobs with… [8.0] Proper handling of waiting jobs when set to be killed Jun 24, 2024
@iueda
Copy link
Contributor

iueda commented Jun 24, 2024

I think the current indentation is correct, for eg. SUBMITTING is not allowed to go to KILLED:

            SUBMITTING: State(0, [RECEIVED, CHECKING, DELETED], defState=SUBMITTING),  # initial state

WAITING is allowed to go to KILLED since #7276, so it should be moved from this list of job statuses which are not allowed to go to KILLED to that which can go to KILLED.

Or, can't the possible states transitions (https://github.com/DIRACGrid/DIRAC/blob/rel-v8r0/src/DIRAC/WorkloadManagementSystem/Client/JobStatus.py) be checked instead of these hard-coded list?

@fstagni
Copy link
Contributor

fstagni commented Jun 25, 2024

I think @iueda is correct. For checking the state transitions,

def filterJobStateTransition(jobIDs, candidateState, jobMonitoringClient=None):
(`‎filterJobStateTransition) can be used.

@michmx
Copy link
Author

michmx commented Jun 25, 2024

@fstagni we have a fundamental question before moving on with this PR or a more elaborated implementation. When you have a job in Waiting status, is it meaningful to use sendKillCommand=True in killJob()?

I ask because with the current indentation, only statuses not hard-coded are appended in the markKilledJobList, which use sendKillCommand=False (this was the behavior on DIRAC v7r2 for waiting jobs).

Moving the Waiting status to line 520 would add them to killJobList, using sendKillCommand=True.

@fstagni
Copy link
Contributor

fstagni commented Jun 26, 2024

sendKillCommand=True is effectively only meaningful when the job is already running. For any other state it does not make sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alsoTargeting:integration Cherry pick this PR to integration after merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants