Tryton - Issues

 

Issue8781

Title Size limit on notify-based cache clearing
Priority bug Status resolved
Superseder Nosy List ced, jcavallo, pokoli, reviewbot, roundup-bot
Type crash Components trytond
Assigned To ced Keywords review
Reviews 309371003
View: 309371003

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

Messages
New changeset a7b3f8754c82 by Cédric Krier in branch '5.4':
Limit size of cache to reset per notify call
https://hg.tryton.org/trytond/rev/a7b3f8754c82

New changeset b3a4c0c89001 by Cédric Krier in branch '5.2':
Limit size of cache to reset per notify call
https://hg.tryton.org/trytond/rev/b3a4c0c89001
New changeset 8f98c02bd026 by Cédric Krier in branch 'default':
Limit size of cache to reset per notify call
https://hg.tryton.org/tryton-env/rev/8f98c02bd026
New changeset 4e240b35cbc8 by Cédric Krier in branch 'default':
Limit size of cache to reset per notify call
https://hg.tryton.org/trytond/rev/4e240b35cbc8
review309371003 updated at https://codereview.tryton.org/309371003/#ps317261002
review309371003 updated at https://codereview.tryton.org/309371003/#ps307401002
msg57245 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2020-04-18.00:01:44
Here is review309371003
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
Hello,

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.
History
Date User Action Args
2020-04-25 12:56:22roundup-botsetmessages: + msg57471
keyword: - backport
2020-04-19 16:38:15roundup-botsetmessages: + msg57308
2020-04-19 16:38:09roundup-botsetstatus: testing -> resolved
nosy: + roundup-bot
messages: + msg57307
2020-04-19 16:37:30cedsettype: behavior -> crash
keyword: + backport
2020-04-19 11:39:55reviewbotsetmessages: + msg57291
2020-04-18 00:08:31reviewbotsetnosy: + reviewbot
messages: + msg57247
2020-04-18 00:01:44cedsetstatus: chatting -> testing
reviews: 309371003
messages: + msg57245
keyword: + review
assignedto: ced
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