4295: Abort on NoMemoryError
authorPeter Amstutz <peter.amstutz@curoverse.com>
Thu, 23 Oct 2014 20:22:48 +0000 (16:22 -0400)
committerPeter Amstutz <peter.amstutz@curoverse.com>
Thu, 23 Oct 2014 20:22:48 +0000 (16:22 -0400)
services/api/lib/eventbus.rb

index a0c0b272e77d9a62b3b0d086418329e644549117..848279f9fda9f3126460c00a8b23239875643272 100644 (file)
@@ -248,6 +248,9 @@ class EventBus
                   @channel.push payload.to_i
                 end
               end
+            rescue NoMemoryError
+              EventMachine::stop_event_loop
+              abort "Out of memory"
             ensure
               # Don't want the connection to still be listening once we return
               # it to the pool - could result in weird behavior for the next