Skip to content
Open
Changes from all commits
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
6 changes: 6 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 @@ -150,8 +151,13 @@ def commit(self):
# if we managed to publish the records we can delete from the list
recordSent += len(recordsToSend)
del documents[: self.__maxRecordsInABundle]
try_count = 0
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