Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/DIRAC/MonitoringSystem/Client/MonitoringReporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ def commit(self):
self.__documents = []
self.__documentLock.release()
recordSent = 0
try_count = 0
try:
while documents:
recordsToSend = documents[: self.__maxRecordsInABundle]
Expand All @@ -152,6 +153,10 @@ def commit(self):
del documents[: self.__maxRecordsInABundle]
else:
gLogger.warn("Failed to insert the records:", retVal["Message"])
try_count += 1
if try_count == 10:
gLogger.error("Failed to insert Monitoring records after 10 attempts")
break
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should try_count be reset if a bundle is sucessfully sent?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed.

except Exception as e: # pylint: disable=broad-except
gLogger.exception("Error committing", lException=e)
return S_ERROR(f"Error committing {repr(e).replace(',)',')')}")
Expand Down
Loading