Issue 1:
I've a problem with Celery parent thread. It works, but CPU consumption is near 100%.

Top output is:

28337 xxx 20 0 658m 101m 35m R 100 0.6 844:58.47 celery

Celery version is:

celery report

software -> celery:3.1.8 (Cipater) kombu:3.0.10 py:2.7.3

billiard:3.3.0.14 py-amqp:1.4.2

platform -> system:Linux arch:64bit, ELF imp:CPython

loader -> celery.loaders.default.Loader

settings -> transport:amqp results:disabled

Strace shows repeated epoll_ctl calls.

strace -p 28337

epoll_ctl(4, EPOLL_CTL_DEL, 28, {EPOLLRDNORM|EPOLLWRBAND|0x4c6820, {u32=0, u64=21512400263970816}}) = -1 ENOENT (No such file or directory)

epoll_ctl(4, EPOLL_CTL_DEL, 32, {EPOLLRDNORM|EPOLLWRBAND|0x4c6820, {u32=0, u64=21512400263970816}}) = -1 ENOENT (No such file or directory)

epoll_ctl(4, EPOLL_CTL_DEL, 36, {EPOLLRDNORM|EPOLLWRBAND|0x4c6820, {u32=0, u64=21512400263970816}}) = -1 ENOENT (No such file or directory)

epoll_ctl(4, EPOLL_CTL_DEL, 40, {EPOLLRDNORM|EPOLLWRBAND|0x4c6820, {u32=0, u64=21512400263970816}}) = -1 ENOENT (No such file or directory)

I have JSON serializer and some connections to HBase in my workers.

Issue 2:
Hello,

We're using Celery 3.1.6, and one of our queues is using 100% CPU for the master process. ps shows:

root 6960 59.2 0.7 160680 51628 ? Rs Feb01 2319:49 /$VENV/bin/python /$VENV/manage.py celery worker -Q ads -P prefork --autoscale=10,5 -n $NAME --settings=settings -l INFO
root 32727 0.3 1.1 266008 82860 ? S Feb02 6:29 \_ /$VENV/bin/python /$VENV/manage.py celery worker -Q ads -P prefork --autoscale=10,5 -n $NAME --settings=settings -l INFO
root 32729 0.2 1.1 265184 82040 ? S Feb02 5:54 \_ /$VENV/bin/python /$VENV/manage.py celery worker -Q ads -P prefork --autoscale=10,5 -n $NAME --settings=settings -l INFO
root 32730 0.2 1.4 282868 99788 ? S Feb02 5:29 \_ /$VENV/bin/python /$VENV/manage.py celery worker -Q ads -P prefork --autoscale=10,5 -n $NAME --settings=settings -l INFO
root 750 0.1 1.5 296584 113100 ? S Feb02 3:03 \_ /$VENV/bin/python /$VENV/manage.py celery worker -Q ads -P prefork --autoscale=10,5 -n $NAME --settings=settings -l INFO
root 917 0.2 1.1 262044 78888 ? S Feb02 6:00 \_ /$VENV/bin/python /$VENV/manage.py celery worker -Q ads -P prefork --autoscale=10,5 -n $NAME --settings=settings -l INFO
root 1873 0.0 1.2 269460 86276 ? S Feb02 1:34 \_ /$VENV/bin/python /$VENV/manage.py celery worker -Q ads -P prefork --autoscale=10,5 -n $NAME --settings=settings -l INFO
root 1875 0.0 1.4 285568 102384 ? S Feb02 0:36 \_ /$VENV/bin/python /$VENV/manage.py celery worker -Q ads -P prefork --autoscale=10,5 -n $NAME --settings=settings -l INFO
root 2347 0.0 0.8 245448 60984 ? S Feb02 1:47 \_ /$VENV/bin/python /$VENV/manage.py celery worker -Q ads -P prefork --autoscale=10,5 -n $NAME --settings=settings -l INFO
root 2348 0.0 0.8 247760 63356 ? S Feb02 1:33 \_ /$VENV/bin/python /$VENV/manage.py celery worker -Q ads -P prefork --autoscale=10,5 -n $NAME --settings=settings -l INFO
root 2362 0.0 1.0 257880 73416 ? S Feb02 1:09 \_ /$VENV/bin/python /$VENV/manage.py celery worker -Q ads -P prefork --autoscale=10,5 -n $NAME --settings=settings -l INFO

And strace is more interesting. It shows the following loop as the only thing happening in the parent:

gettimeofday({1391450996, 406286}, NULL) = 0
epoll_wait(4, {{EPOLLIN, {u32=6, u64=22205092589469702}}}, 1023, 1000) = 1
epoll_ctl(4, EPOLL_CTL_DEL, 34, {EPOLLRDNORM|EPOLLRDBAND|EPOLLWRNORM|EPOLLMSG|0x4e9020, {u32=0, u64=22205092589469696}}) = -1 ENOENT (No such file or directory)
epoll_ctl(4, EPOLL_CTL_DEL, 67, {EPOLLRDNORM|EPOLLRDBAND|EPOLLWRNORM|EPOLLMSG|0x4e9020, {u32=0, u64=22205092589469696}}) = -1 ENOENT (No such file or directory)
epoll_ctl(4, EPOLL_CTL_DEL, 68, {EPOLLRDNORM|EPOLLRDBAND|EPOLLWRNORM|EPOLLMSG|0x4e9020, {u32=0, u64=22205092589469696}}) = -1 ENOENT (No such file or directory)
epoll_ctl(4, EPOLL_CTL_DEL, 38, {EPOLLRDNORM|EPOLLRDBAND|EPOLLWRNORM|EPOLLMSG|0x4e9020, {u32=0, u64=22205092589469696}}) = -1 ENOENT (No such file or directory)
epoll_ctl(4, EPOLL_CTL_DEL, 10, {EPOLLRDNORM|EPOLLRDBAND|EPOLLWRNORM|EPOLLMSG|0x4e9020, {u32=0, u64=22205092589469696}}) = -1 ENOENT (No such file or directory)
epoll_ctl(4, EPOLL_CTL_DEL, 53, {EPOLLRDNORM|EPOLLRDBAND|EPOLLWRNORM|EPOLLMSG|0x4e9020, {u32=0, u64=22205092589469696}}) = -1 ENOENT (No such file or directory)
epoll_ctl(4, EPOLL_CTL_DEL, 26, {EPOLLRDNORM|EPOLLRDBAND|EPOLLWRNORM|EPOLLMSG|0x4e9020, {u32=0, u64=22205092589469696}}) = -1 ENOENT (No such file or directory)
epoll_ctl(4, EPOLL_CTL_DEL, 59, {EPOLLRDNORM|EPOLLRDBAND|EPOLLWRNORM|EPOLLMSG|0x4e9020, {u32=0, u64=22205092589469696}}) = -1 ENOENT (No such file or directory)
epoll_ctl(4, EPOLL_CTL_DEL, 30, {EPOLLRDNORM|EPOLLRDBAND|EPOLLWRNORM|EPOLLMSG|0x4e9020, {u32=0, u64=22205092589469696}}) = -1 ENOENT (No such file or directory)
epoll_ctl(4, EPOLL_CTL_DEL, 63, {EPOLLRDNORM|EPOLLRDBAND|EPOLLWRNORM|EPOLLMSG|0x4e9020, {u32=0, u64=22205092589469696}}) = -1 ENOENT (No such file or directory)
epoll_ctl(4, EPOLL_CTL_ADD, 51, {EPOLLIN|EPOLLERR|EPOLLHUP, {u32=51, u64=22205092589469747}}) = -1 EEXIST (File exists)
epoll_ctl(4, EPOLL_CTL_ADD, 52, {EPOLLIN|EPOLLERR|EPOLLHUP, {u32=52, u64=22205092589469748}}) = -1 EEXIST (File exists)
epoll_ctl(4, EPOLL_CTL_ADD, 6, {EPOLLIN|EPOLLERR|EPOLLHUP, {u32=6, u64=22205092589469702}}) = -1 EEXIST (File exists)

Those FDs are pipes according to /proc/$PID/fd. (strace also shows heartbeat/worker chatter from other processes read via the redis socket).

Restarting the upstart job caused the worker to begin consuming tasks again. I think this is some corner case that isn't being handled well. Kombu's eventio.py has the following:

class _epoll(Poller):
# ...
def register(self, fd, events):
try:
self._epoll.register(fd, events)
except Exception as exc:
if get_errno(exc) != errno.EEXIST:
raise
def unregister(self, fd):
try:
self._epoll.unregister(fd)
except (socket.error, ValueError, KeyError):
pass
except (IOError, OSError) as exc:
if get_errno(exc) != errno.ENOENT:
raise

We are specifically checking for ENOENT and EEXIST here and silently dropping the exception - it seems like this might be causing a problem for someone further down the stack, but I'm not familiar with this part of celery.

Any help/pointers appreciated. Let me know what other info is useful as well.