-
Notifications
You must be signed in to change notification settings - Fork 185
Fix: do not need storage management db #8515
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
base: integration
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| from DIRAC import S_ERROR, S_OK, gLogger | ||
| from DIRAC.WorkloadManagementSystem.Client import JobStatus | ||
| from DIRAC.Core.Utilities.ObjectLoader import ObjectLoader | ||
| from DIRAC.WorkloadManagementSystem.Client import JobStatus | ||
| from DIRAC.WorkloadManagementSystem.Service.JobPolicy import RIGHT_DELETE, RIGHT_KILL | ||
| from DIRAC.WorkloadManagementSystem.Utilities.jobAdministration import _filterJobStateTransition | ||
|
|
||
|
|
@@ -96,11 +96,6 @@ def kill_delete_jobs( | |
| if not result["OK"]: | ||
| return result | ||
| pilotagentsdb = result["Value"]() | ||
| if storagemanagementdb is None: | ||
| result = ObjectLoader().loadObject("StorageManagementSystem.DB.StorageManagementDB", "StorageManagementDB") | ||
| if not result["OK"]: | ||
| return result | ||
| storagemanagementdb = result["Value"]() | ||
|
|
||
| badIDs = [] | ||
|
|
||
|
|
@@ -133,6 +128,14 @@ def kill_delete_jobs( | |
| stagingJobList = [jobID for jobID, sDict in jobStates.items() if sDict["Status"] == JobStatus.STAGING] | ||
|
|
||
| if stagingJobList: | ||
| if storagemanagementdb is None: | ||
| result = ObjectLoader().loadObject( | ||
| "StorageManagementSystem.DB.StorageManagementDB", "StorageManagementDB" | ||
| ) | ||
| if not result["OK"]: | ||
| return result | ||
| storagemanagementdb = result["Value"]() | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does happen here if an exception is raised?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This would be a real exception, which I think it makes sense that it is propagated: if that happens it means that:
I do not see how this could ever happen, unless someone installs the StorageManagementSystem only to remove it later. |
||
|
|
||
| gLogger.info("Going to send killing signal to stager as well!") | ||
| result = storagemanagementdb.killTasksBySourceTaskID(stagingJobList) | ||
| if not result["OK"]: | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.