Retry engine trys to write bad data to Kafka

The retry engine did not convert a notification object into json before
attempting to send it to Kafka and the Kafka publisher raised an exception.
This causes the notification system to restart before committing that offset to
Kafka.  At that point the notification system is stuck because there's no way
to move past the notification that's causing the restart.

Change-Id: I473a0fa14f28b945702d879f5b17c5807f89e887
Closes-Bug:#1566057
This commit is contained in:
Joe Keen 2016-04-04 17:23:45 -06:00 committed by Michael James Hoppal
parent 5a71ece0ac
commit b6b3b1a419
1 changed files with 2 additions and 2 deletions

View File

@ -1,4 +1,4 @@
# (C) Copyright 2015 Hewlett Packard Enterprise Development Company LP
# (C) Copyright 2015-2016 Hewlett Packard Enterprise Development Company LP
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -78,7 +78,7 @@ class RetryEngine(object):
sent, failed = self._notifier.send([notification])
if sent:
self._producer.publish(self._topics['notification_topic'], sent)
self._producer.publish(self._topics['notification_topic'], [sent.to_json()])
if failed:
notification.retry_count += 1