From f640f4bb2f19e57971e1162955ae9c7cae38973f Mon Sep 17 00:00:00 2001 From: Ranjeeth Dasineni Date: Fri, 16 Oct 2015 17:22:49 -0700 Subject: [PATCH] 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 --- folly/io/async/NotificationQueue.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.34.1