status with multiple container
When running multiple Tryton containers (for serving, cron, worker etc), the database path is mounted with the same volume for all the containers. So when running trytond-stat
on any container, it creates the file socket for all the containers. This should not be a problem as the socket communication is design to receive from multiple processes because we rely on the PID to distinct the data from each processes. The problem is that the PID (from os.getpid()
) inside a container can be the same as another process inside another container (and the odds are hight to have collision as docker tent to start with low PID).
I could not find a way to get real PID of the process from inside the container (I think it is on purpose for security reason). And anyway it will not solve completely the problem is the containers are run on multiple machines.
So a possible idea will be to use a UUID that is generated once by the status when starting the dumper and use this UUID as unique identifier to store processes in trytond-stat.