ZEO deadlocks on uWSGI in master mode

290 views Asked by At

Good day!

I am migrating to uWSGI deployment. The project is half on ZOPE3 and uses ZODB with ZEO for multiple access. If I start the uwsgi daemon like this:

uwsgi_python27 --http :9090 --wsgi-file /path/to/file

Everything runs OK. It's the Single Process mode. No blocks or locks. When I start the app like this:

uwsgi_python27 --http :9090 --wsgi-file /path/to/file -p 3

Everythig runs. It's the Preforking mode. We have good results. But some requests block. I suspect that the app blocks 1 request when the new instance starts. I have 2-3 locked request. All other work good.

But when I start like this:

uwsgi_python27 --http :9090 --wsgi-file /path/to/file --master

The app launches, but no requests are served. When I go curl localhost:9090/some_page it never loads anything. No CPU no disk usage. It just locks.

Does someone know any specific ZEO behavior, that could result into this? If I run just FileStorage it runs normally without any deadlocks. Any details about the master mode of uWSGI behavior would also be appreciated.

1

There are 1 answers

0
Taras Voinarovskyi On BEST ANSWER

Ok. So I managed to launch the damn thing. I suspect, that ZEO's rpc works bad with linux forking. So you need to start the app only in the forked process, not before forking.

See lazy or lazy-apps configuration options for uwsgi.

ref: http://uwsgi-docs.readthedocs.org/en/latest/ThingsToKnow.html