From: Ranjeeth Dasineni Date: Sat, 17 Oct 2015 00:22:49 +0000 (-0700) Subject: Change NotificationQueue assert -> CHECK X-Git-Tag: deprecate-dynamic-initializer~313 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=f640f4bb2f19e57971e1162955ae9c7cae38973f;p=folly.git Change NotificationQueue assert -> CHECK Summary: If the eventFd goes bad, NotificationQueue consumers can cause their event loop to spin indefinitely. If libevent gets POLLERR on the fd, it calls handlerReady, which triggers a read. The read will fail, but the callback is never uninstalled. I'm not sure it would be easy to recover gracefully from this, so crash hard instead. Reviewed By: yfeldblum, pgriess Differential Revision: D2550270 fb-gh-sync-id: c9575fbda778b3625da6d9db6b0542b8263f230a --- diff --git a/folly/io/async/NotificationQueue.h b/folly/io/async/NotificationQueue.h index 32cda256..129096f6 100644 --- a/folly/io/async/NotificationQueue.h +++ b/folly/io/async/NotificationQueue.h @@ -506,7 +506,7 @@ class NotificationQueue { if (rc < 0) { // EAGAIN should pretty much be the only error we can ever get. // This means someone else already processed the only available message. - assert(errno == EAGAIN); + CHECK_EQ(errno, EAGAIN); return false; } assert(value == 1);