Skip to content

Commit 14e4ff4

Browse files
committed
feat: add a log to debug issue while retrieving pilot outputs
1 parent 1ea0d9a commit 14e4ff4

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/DIRAC/WorkloadManagementSystem/Service/PilotManagerHandler.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@ def export_getPilotOutput(self, pilotReference):
9393

9494
result = self.pilotAgentsDB.getPilotInfo(pilotReference)
9595
if not result["OK"]:
96-
self.log.error("Failed to get info for pilot", result["Message"])
96+
self.log.error("Failed to get info for pilot", f"{pilotReference}: {result['Message']}")
9797
return S_ERROR("Failed to get info for pilot")
9898
if not result["Value"]:
99-
self.log.warn("The pilot info is empty", pilotReference)
99+
self.log.warn("The pilot info is empty for", pilotReference)
100100
return S_ERROR("Pilot info is empty")
101101

102102
pilotDict = result["Value"][pilotReference]
@@ -105,11 +105,14 @@ def export_getPilotOutput(self, pilotReference):
105105
# classic logs first, by default
106106
funcs = [self._getPilotOutput, self._getRemotePilotOutput]
107107
if remote:
108+
self.log.info("Trying to retrieve output of pilot", f"{pilotReference} remotely first")
108109
funcs.reverse()
109110

110111
result = funcs[0](pilotReference, pilotDict)
111112
if not result["OK"]:
112-
self.log.warn("Pilot log retrieval failed (first attempt), remote ?", remote)
113+
self.log.warn(
114+
"Failed getting output for pilot", f"{pilotReference}. Will try another approach: {result['Message']}"
115+
)
113116
result = funcs[1](pilotReference, pilotDict)
114117
return result
115118
else:

0 commit comments

Comments
 (0)