El 28/08/17 a les 12:46, Cédric Krier ha escrit:
On 2017-08-28 12:14, Sergi Almacellas Abellana wrote:
Hi,

Currently there is a weird behavior if new modules are installed when
running multiple instances of trytond (as separate process). The problem
is that only one process has the updated pool definition and the other
process will fail with a KeyError when try to get the new created models.

I think this can be solved like we sync the cache resets between instances:

1. Store on the database the pool version.
2. Each time the pool is updated, a new version is saved on the database.
3. Before staring a request that requires the pool, fetch the version
from database and  check if it matches with the current pool version
(stored in memory). If it does not match, reload the pool before
processing the request.

This has the drawback that adds one additional query *per request*.

Thoughts?

For me, activate modules from the UI has always been a gadget (or for
simple setup).

Indeed this has nothing to do with the UI, as it can be reproduced with trytond-admin also.

On larger setup with multiple server, the activation
should be part of a larger maintenance process which should restart all
of them.

The problem I see here is that there is no standard process. Let me explain:

Everyone can deploy the processes in different ways, so each different way of deployment should develop a larger maintenance process that fits its needs.

So we should probably define a standard way or some common procedure.

For us, it will be enough to be able to query the server and return some status code to know which instances are not updated.


My second point, is that adding a extra query for each request just of
the very rare case of activating a new module is really too much costly.

I will like to avoid this query on each request too, probably it will be enough to do it on some time interval.

Indeed I would prefer to have a configuration option that disable the
activation of module from the UI.


That can be achieved by restricting permissions on the UI buttons and actions. But for me it's out of the scope of this discussion.

--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk

--
You received this message because you are subscribed to the Google Groups 
"tryton-dev" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton-dev/21a4f41e-e831-7310-bf0a-e24ff9b56fc9%40koolpi.com.

Reply via email to