summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js/transcoder.js
diff options
context:
space:
mode:
authorOlivier Dony <odo@openerp.com>2015-09-15 19:10:23 +0200
committerOlivier Dony <odo@openerp.com>2015-09-15 19:38:19 +0200
commit2b1cdd551f54bcd7ad15aae1c76ba5d80dd85d95 (patch)
tree2e44d3422810af315f615c5f0b18994e339b50c1 /addons/web_editor/static/src/js/transcoder.js
parenta139d81c46b669fa9186ceaf2a0ca43fb0601e1c (diff)
[FIX] fields.float: avoid non-deterministic side-effects on other cursors
In 5efac22043adc735d9502fb9f6f7466b85916573 and 1cf5723835235c71df140938282420360116f0c5 the computation of the decimal precision of float fields was modified to reuse a random cursor from the request environments. Environment.envs is a WeakSet, subject to unpredictable garbage collections. This could cause hard-to-diagnose problems by executing a SELECT query in a cursor that is supposed to be otherwise idle and untouched. As an example, this could cause a transaction start in a cursor that was just committed/rolled back, and was waiting for another operation to complete. One such case happened semi-randomly during a module installation triggered from the web client, where the request cursor is committed and waiting for the registry initialization done with a different cursor, in the middle of _button_immediate_function() After the registry initialization, the request cursor is used again to determine the next action (ir.actions.todo), and this could cause a TransactionRollbackError if the request cursor was used during the initialization. Using a new cursor every time is much safer, simpler, and will not cause any significant performance hit, because it will usually grab an available connection from the connection pool, rather than create a new one. Fixes opw-649151
Diffstat (limited to 'addons/web_editor/static/src/js/transcoder.js')
0 files changed, 0 insertions, 0 deletions