Created on 2021-09-02.11:12:11 by ced, last changed 3 weeks ago by roundup-bot.
New changeset ad527be4ed6e by Cédric Krier in branch 'default': Add node to id of status https://hg.tryton.org/tryton-env/rev/ad527be4ed6e
New changeset bf276f67b2c4 by Cédric Krier in branch 'default': Add node to id of status https://hg.tryton.org/trytond/rev/bf276f67b2c4
The problem is that usually with docker deployment, the hostname of multiple same container is just suffixed by an indice. So the end has a very meaningful.
I think the best solution would be in case of long name:
<pid@hostname> and increase padding to 10 digits should do the trick.
It looks like it could work considering that docker hostname must be unique.
Also it has the advantage to provide a way to the user to find where is the process if we display the
hostname-pid in the stat. So we could just prepend to the pid the hostname. The only problem is that we pad PID to 5 but now it will be random length. So we will probably need to ellipsis (in the middle) in the rendering the hostname if it is too long.
Should we use the hostname-pid combination?
When using docker, the hostname is different for each container so it will make it unique without the need of an uuid.
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.
|2021-09-23 10:04:41||roundup-bot||set||messages: + msg70288|
nosy: + roundup-bot
status: testing -> resolved
nosy: + reviewbot
|2021-09-11 00:09:20||ced||set||assignedto: ced|
keyword: + review
status: chatting -> testing
|2021-09-02 15:53:30||ced||set||messages: + msg69792|
|2021-09-02 15:16:24||pokoli||set||messages: + msg69791|
|2021-09-02 11:47:51||ced||set||messages: + msg69781|
nosy: + pokoli
status: unread -> chatting
Showing 10 items. Show all history (warning: this could be VERY long)