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

Faster Dirac.deleteJob Implementation? #7314

Closed
sfayer opened this issue Nov 27, 2023 · 2 comments
Closed

Faster Dirac.deleteJob Implementation? #7314

sfayer opened this issue Nov 27, 2023 · 2 comments

Comments

@sfayer
Copy link
Member

sfayer commented Nov 27, 2023

Hi,

When a user deletes a large batch of jobs via the API or command line, it can take a long time. We've tracked it down to this loop making a call to the server for each individual job:

for jobID in jobIDs:
can_kill = JobStatus.checkJobStateTransition(jobID, JobStatus.KILLED)["OK"]
can_del = JobStatus.checkJobStateTransition(jobID, JobStatus.DELETED)["OK"]
if can_kill or can_del:
jobIDsToDelete.append(jobID)

(We tried it with that loop removed and it was significantly faster).

Would it be possible to replace it with some kind of bulk version? (I was going to suggest removing those lines entirely as I think the same check is done server-side, but it seems like they were added specially here for some reason?)

Regards,
Simon

@fstagni
Copy link
Contributor

fstagni commented Nov 28, 2023

This check was first introduced by me in #5752 and then edited by you in #6665. Unfortunately, my bad, I did not add in the first PR an explanation on why it was necessary but I think I remember that it was done exactly to avoid some issues with the interplay of server side check (like: the user was setting some status that was then "silently" refused server side).

It is I think possible to make it bulk. Would you give it a try, or should I?

@sfayer
Copy link
Member Author

sfayer commented Nov 28, 2023

Thanks, I'll have a look at sorting it out...

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

No branches or pull requests

2 participants