On 6 March 2015 at 16:31, Ralph Bean <rbean@redhat.com> wrote:
I'd like to apply this hotfix to the notifications backend to have it
drop all the messages in its queue about builds being deleted from
koji.

Koji garbage collection just started working again, and it's been
spouting messages all day long about it.  It's about halfway through
the alphabet and we now have a multiple-hour-long backlog in the FMN
queue:  http://threebean.org/fedmsg-health-day.html#FMN

This will only be temporary until this wave is over.  We'll resume
notifying people about deleted builds after this is done with.

Note that, we'll still have a record about what builds were deleted in
the datagrepper history.  This will only squash the developer
notifications.


OK sounds good +1

 
Can I get two +1s to apply this change?


diff --git a/fmn/consumer/consumer.py b/fmn/consumer/consumer.py
index 9840b93..99f4239 100644
--- a/fmn/consumer/consumer.py
+++ b/fmn/consumer/consumer.py
@@ -101,6 +101,13 @@ class FMNConsumer(fedmsg.consumers.FedmsgConsumer):
                 log.debug("Dropping %r", topic)
                 return

+        if topic.endswith('buildsys.build.state.change'):
+            # This is the internal koji code for a "deleted" build
+            # See an example here:  http://da.gd/41KV
+            if msg['msg']['new'] == 2:
+                log.debug('Dropping deleted build message.')
+                return
+
         start = time.time()
         log.debug("FMNConsumer received %s %s", msg['msg_id'], msg['topic'])


_______________________________________________
infrastructure mailing list
infrastructure@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/infrastructure



--
Stephen J Smoogen.