On 2017-08-28 14:27, Sergi Almacellas Abellana wrote: > 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.
So the admin knows he has to restart all the services. > 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 me, it will be a disadvantage to limit the way Tryton is deployed. > 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. I do not see the point. Instead of querying just restart. > > 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. That sounds odd. You can not expect correct behaviour with such design. > > 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. It is not for me because the problem is in the UI because admin user is not necessary and server administrator. But if the feature is limited to server administrator, there is no problem. -- Cédric Krier - B2CK SPRL Email/Jabber: cedric.kr...@b2ck.com Tel: +32 472 54 46 59 Website: http://www.b2ck.com/ -- 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/20170828130443.GE3668%40kei.