Skip to content

Commit 674276c

Browse files
authored
Merge pull request #8140 from chrisburr/dirac-jobexec-why
[9.0] Make it possible to debug dirac-jobexec failures
2 parents 407a3af + 09c31f5 commit 674276c

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/DIRAC/Core/Utilities/Proxy.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,6 @@ def wrapped_fcn(*args, **kwargs):
160160

161161
try:
162162
return fcn(*args, **kwargs)
163-
except Exception as lException: # pylint: disable=broad-except
164-
value = ",".join([str(arg) for arg in lException.args])
165-
exceptType = lException.__class__.__name__
166-
return S_ERROR(f"Exception - {exceptType}: {value}")
167163
finally:
168164
# Restore the default host certificate usage if necessary
169165
if useServerCertificate:

src/DIRAC/WorkloadManagementSystem/scripts/dirac_jobexec.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import DIRAC
1111
from DIRAC.Core.Base.Script import Script
12+
from DIRAC.Core.Utilities.ReturnValues import S_ERROR
1213

1314

1415
@Script()
@@ -87,9 +88,13 @@ def jobexec(jobxml, wfParameters):
8788
parDict[name] = value
8889

8990
gLogger.debug("PYTHONPATH:\n%s" % ("\n".join(sys.path)))
90-
jobExec = jobexec(jobXMLfile, parDict)
91+
try:
92+
jobExec = jobexec(jobXMLfile, parDict)
93+
except Exception as e:
94+
gLogger.exception("Workflow execution failed")
95+
jobExec = S_ERROR(f"Workflow execution failed: {e}")
9196
if not jobExec["OK"]:
92-
gLogger.debug("Workflow execution finished with errors, exiting")
97+
gLogger.notice("Workflow execution finished with errors, exiting")
9398
if jobExec["Errno"]:
9499
sys.exit(jobExec["Errno"])
95100
else:

0 commit comments

Comments
 (0)