Hi,

I have the following uwsgi .ini:

[uwsgi]
socket = /tmp/%n.sock
chown-socket = www:www
chdir = /tmp/uwsgi
mount = /abcd=abcd.py
mount = /efgh=efgh.py
processes = 2
mule = /tmp/uwsgi/mule.py
uid = www
gid = www
log-master-buf=16384
gevent = 100

mule.py looks like:

import gevent

def loop():
    print "Hi! I am loop."
    while True:
        gevent.sleep(2)
        print "This is a thread!"


if __name__ == '__main__':
    loop()

When I start this, I get:

Dec  4 16:00:12 japan uwsgi: spawned uWSGI mule 1 (pid: 53755)
Dec  4 16:00:12 japan uwsgi: Hi! I am loop.
Dec  4 16:00:12 japan uwsgi: SystemError: (libev) kevent: Bad file descriptor
Dec  4 16:00:12 japan uwsgi: Mon Dec  4 16:00:12 2017
Dec  4 16:00:12 japan uwsgi:
Dec  4 16:00:12 japan uwsgi: Traceback (most recent call last):
Dec  4 16:00:12 japan uwsgi:   File "/tmp/uwsgi/mule.py", line 23, in <module>
Dec  4 16:00:12 japan uwsgi:
Dec  4 16:00:12 japan uwsgi: loop2()
Dec  4 16:00:12 japan uwsgi:
Dec  4 16:00:12 japan uwsgi:   File "/tmp/uwsgi/mule.py", line 15, in loop2
Dec  4 16:00:12 japan uwsgi:
Dec  4 16:00:12 japan uwsgi: gevent.sleep(2)
Dec  4 16:00:12 japan uwsgi:   File "/usr/local/lib/python2.7/site-packages/gevent/hub.py", line 169, in sleep
Dec  4 16:00:12 japan uwsgi:
Dec  4 16:00:12 japan uwsgi: hub.wait(loop.timer(seconds, ref=ref))
Dec  4 16:00:12 japan uwsgi:   File "/usr/local/lib/python2.7/site-packages/gevent/hub.py", line 651, in wait
Dec  4 16:00:12 japan uwsgi:
Dec  4 16:00:12 japan uwsgi: result = waiter.get()
Dec  4 16:00:12 japan uwsgi:   File "/usr/local/lib/python2.7/site-packages/gevent/hub.py", line 898, in get
Dec  4 16:00:12 japan uwsgi:
Dec  4 16:00:12 japan uwsgi: return self.hub.switch()
Dec  4 16:00:12 japan uwsgi:   File "/usr/local/lib/python2.7/site-packages/gevent/hub.py", line 630, in switch
Dec  4 16:00:12 japan uwsgi:
Dec  4 16:00:12 japan uwsgi: return RawGreenlet.switch(self)
Dec  4 16:00:12 japan uwsgi: SystemError
Dec  4 16:00:12 japan uwsgi: :
Dec  4 16:00:12 japan uwsgi: (libev) kevent: Bad file descriptor
Dec  4 16:00:12 japan uwsgi:
Dec  4 16:00:12 japan uwsgi: OOOPS mule 1 (pid: 53755) crippled...trying respawn...

Am I doing something wrong?

How can I run gevent apps and gevent mules?

BTW, what I really want to achieve here is to run processes under uwsgi's supervision which do background jobs in the controlled number of processes (independent of the applications proc num).

Also, it would be nice to be able to communicate with them via RPC if it's possible.

_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to