Skip to content
Snippets Groups Projects
Commit 3e7f2741 authored by Deep Chatterjee's avatar Deep Chatterjee
Browse files

handle timeout from kafka

parent 5e90d979
No related branches found
No related tags found
No related merge requests found
Pipeline #447077 passed
......@@ -2,6 +2,7 @@ import json
from threading import Thread
import warnings
from adc.errors import KafkaException
from celery import bootsteps
from celery.utils.log import get_logger
from hop.models import JSONBlob
......@@ -70,8 +71,11 @@ class IGWNAlertClient(client):
else:
callback(topic=metadata.topic.split('.')[1],
payload=payload)
except (KeyboardInterrupt, SystemExit):
self.running = False
except KafkaException as err:
if '_TIMED_OUT' in err.name:
log.exception("Timeout from kafka")
else:
raise
s.close()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment