Skip to content

Commit

Permalink
hot-fix(RHINENG-4855): Add expection to write_event (#1560)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpramos123 authored Nov 23, 2023
1 parent 470f226 commit 328674b
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions lib/host_synchronize.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,17 @@ def synchronize_hosts(select_query, event_producer, chunk_size, config, interrup
host.system_profile_facts.get("operating_system", {}).get("name"),
)
# in case of a failed update event, event_producer logs the message.
event_producer.write_event(event, str(host.id), headers, wait=True)
synchronize_host_count.inc()
logger.info("Synchronized host: %s", str(host.id))

num_synchronized += 1
# Workaround to solve: https://issues.redhat.com/browse/RHINENG-4856
try:
event_producer.write_event(event, str(host.id), headers, wait=True)
synchronize_host_count.inc()
logger.info("Synchronized host: %s", str(host.id))

num_synchronized += 1
except ProduceError:
logger.error(f"Failed to synchronize host: {str(host.id)} because of {ProduceError.code}")
continue

try:
# pace the events production speed as flush completes sending all buffered records.
Expand Down

0 comments on commit 328674b

Please sign in to comment.