Basically, port_getn claims to have events ready to be processed, when in reality, there are none. There are quite a few patches for this problem floating around, all of which are too complicated for my taste.
The following very small patch worked fine for me:
diff -ur php-7.0.13~/sapi/fpm/fpm/events/port.c php-7.0.13/sapi/fpm/fpm/events/port.c
--- php-7.0.13~/sapi/fpm/fpm/events/port.c 2016-11-08 16:07:40.000000000 +0000
+++ php-7.0.13/sapi/fpm/fpm/events/port.c 2016-11-12 12:47:24.964771094 +0000
@@ -138,7 +138,7 @@
for (i = 0; i < nget; i++) {
/ do we have a ptr to the event ? /
- if (!events[i].portev_user) {
+ if (events[i].portev_source == 0 || !events[i].portev_user) {
continue;
}
The idea is to check whether a proper event source value is set for any events returned by port_getn.