This question has been flagged
1 Reply
7491 Views

When I try to switch to multiprocess mode by setting workers>0 in cfg, I got "bus.bus unavailable" error.

I found some tips in forum and configure the ngix to reverse proxy longpolling request, but finally I found there is no process listen to longpolling_port:8072.Even after I make sure to install psycogreen and gevent,and restart odoo, there is no process listen to port 8072.

I have investigate the source code and found only one line will use longpolling_port, which is in the __init__() of GeventServer, and only when the odoo is configured to use gevent server, the GeventServer will be constructed instead of PreforkServer.

So I am totally confused, which port will be used for longpolling under multiprocess mode?

=========================================================

After further investigating the source code, I found even under multiprocess mode, odoo will use subprocess.popen() to init a gevent mode instance, the call sequence is PreforkServer.run()->process_spawn()->long_polling_spawn(). In fact I have found the gevent process with PS AUX command, but the process still not open 8072 port and are created and closed frequently. I will keep on looking into it and try to figure out the reason.

========================================================

The reason I can not start geventserver is when import gevent.wsgi, it throws exception. Because wsgi was deprecated in gevent 1.3, change the line to import gevent.pywsgi can work around. Now I get gevent process listen to 8072.

But client still report 'bus.bus unavailable' error , I will check reverse proxy settings.

==============================================================

I have updated the proxy settings to correctly forward to destination /longpolling/,

and then restart all client(otherwise the client will still use old port), the error message 'bus.bus unavailable' disappear finally.

Avatar
Discard
Best Answer

I dig into the condition of IM bus implemented and found similar information with you.

In my opinion, we have 2 options:

1. If we are not expected longpolling to serve anythings instead we only need workers > 0 to speed up user experienced. Then we could simply disable longpolling. It doesn't make sense to POST longpolling without appropriate handler. 

2. Provide appropriate handler for receive POST longpolling.

I'm currently in process of doing that, I will let you know if I can make it works.

Avatar
Discard