Hi,
I have a problem with the SAO client when using the bus (I haven’t tried with the python client).
Context : Our client operator works with 3 screens to manage the planning. Each screen displays a different view of the same planning and each view provides a different entry point to edit the planning.
We are using the bus to synchronise the 3 plannings browser tabs and it works as expected.
But we have an issue, since we have activated the bus, we encounter frequent freezes when refreshing the sao web client, when it freezes it’s blocked until “long_polling_timeout” is reached.
Note : the issue is not related to our module, it happens on every screen when the bus is activated.
Is there a setting to prevent this behavior ? Am I missing something ?
For me you are hit by the connection limitation of browsers. As I guess you open in 3 different tabs the client, they execute each one a long-polling connection to the server (see Known Issues and Best Practices for the Use of Long Polling and Streaming in Bidirectional HTTP).
And as you probably use the same host name for the RPC and the bus, this blocks also the new RPC request until one bus connection expire and leave a slot for the RPC until it restart again.
So a good practice is to use a different host name for the bus like that only the bus is blocked if too much tabs are opened.
Such limit is higher if you use HTTP/2 (nginx has a default limit to 1000).
Also it will be better to use the sao tab instead of the browser’s one to reduce resource usage.
I don’t understand how I could use sao tab across 3 different screens. Is it doable ?
I tried different ways but I can’t make it work. Is it doable while using the docker image ?
I tried with extra_hosts in docker compose, but I don’t know how the browser can resolve that.
So I added a host “bushost” on my local machine, the call to bushost:8000/tryton/bus is resolved but the response is empty :
But this makes me think that maybe you are also using the uwsgi server for the long polling which is not great because it consumes one database connection per long polling connection. Indeed you must run a service with trytond --coroutine.
This way it can only be accessed via localhost and only from my machine.
I guess when I deploy to my client server I will have to put the server IP or hostname (instead of localhost) in order to make it accessible to users connected to the network.
Am I missing something here ? Is there a way to make it accessible without knowing the host or maybe is it possible to dynamically put the IP in the docker compose ? I hope this makes sens…
Anyway thanks again for your assistance @ced
Note: The trailing slash is required for TRYTOND_BUS__URL_HOST
It took me some time to figure out what I was missing.
I think I found a solution to be able to access to tryton from localhost and by hostname/ip. It’s working as expected the synchronization of the planning works instantly and no more freezes.
My coworker was modifying an event via the hostname url and I could see his change in real time even if I was connected via localhost !