Tryton - Issues



Title Size limit on notify-based cache clearing
Priority bug Status chatting
Superseder Nosy List ced, jcavallo, pokoli
Type behavior Components trytond
Assigned To Keywords

Created on 2019-10-30.14:33:22 by jcavallo, last changed by ced.

msg52809 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2019-10-30.16:53:00
Also we may store a monotonic time different for each payload processed but this should not be a problem as we already clear cache one by one (so with already different time).
msg52808 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2019-10-30.16:50:27
I guess we could use the grouped_slice to limit the size of the payload.
msg52804 (view) Author: [hidden] (jcavallo) Date: 2019-10-30.14:33:21

I am currently working on a feature where a single transaction happens to clear
a lot (something around the hundred mark) caches at once.

When running a channel-based cache, this leads to a failure when committing the
transaction, when the "Clear Cache" instruction is effectively send to the
running trytond instances:

psycopg2.errors.InvalidParameterValue: payload string too long

The problem is that all caches are invalidated using a single "NOTIFY" call,
even when, as is the case here, there are a lot of caches to clear.

A naïve solution would be to split this call so that the query's size does not
exceed this limit. It should be ok since the NOTIFY's will not be sent to other
workers until the transaction is actually committed in the database, so they
either will be all sent at once, or none of them will.
Date User Action Args
2019-10-30 16:53:00cedsetmessages: + msg52809
2019-10-30 16:50:28cedsetstatus: unread -> chatting
nosy: + ced
messages: + msg52808
2019-10-30 16:29:18pokolisetnosy: + pokoli
2019-10-30 14:33:22jcavallocreate

Showing 10 items. Show all history (warning: this could be VERY long)