Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Deterministic Session GC

Beta License: AGPL-3 OCA/server-tools Translate me on Weblate Try me on Runboat

Whenever a new request is processed by Odoo, this statement is evaluated: random.random() < 0.001 [1]

1 time out of 1000 in average, it will return True and trigger the Garbage Collection of sessions: sessions that have not been active for more than 1 week will be deleted [2]

This random approach can become a problem in some contexts.

On a highly visited Odoo website, many sessions will be created. Going through all of them will take some time, especially on a slow/loaded FS. The Garbage Collection happening randomly, your users will report you cases of Odoo being randomly slow on random actions. They won’t be able to reproduce these cases and you won’t be able to trace them in your odoo logs neither, because calls’ response time doesn’t include the time Odoo spent on the Garbage Collection.

Moreover, on a heavily loaded server, better be in a position to control when does the Garbage Collection happen. One might want to run it once per night only for example.

That’s why we created this module:

  • to disable the default random Garbage Collection

  • to enable administrators to replace it by a deterministic approach:

    • either by using the included Scheduled Action;

    • or by calling the added public method ir.autovacuum:gc_sessions() remotely

Table of contents

Installation

You need to load this module server-wide:

  • By starting Odoo with --load=web,base_deterministic_session_gc

  • Or by updating its configuration file:

[options]
(...)
server_wide_modules = web,base_deterministic_session_gc

You also need to install it in your database if you want to use the provided deterministic approach.

Configuration

You can change the session expiry delay in the Odoo configuration file:

[options]
(...)
; 1 day = 60*60*24 seconds
session_expiry_delay = 86400

Default value is 7 days.

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed feedback.

Do not contact contributors directly about support or help with technical issues.

Credits

Authors

  • Trobz

Contributors

Maintainers

This module is maintained by the OCA.

Odoo Community Association

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

This module is part of the OCA/server-tools project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

Metadata

Release files for odoo13-addon-base-deterministic-session-gc 13.0.1.0.1.dev2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for odoo13-addon-base-deterministic-session-gc 13.0.1.0.1.dev2
File Interpreter ABI Platform Actions
odoo13_addon_base_deterministic_session_gc-13.0.1.0.1.dev2-py3-none-any.whl Python 3 none any Details for odoo13_addon_base_deterministic_session_gc-13.0.1.0.1.dev2-py3-none-any.whl

Release files / odoo13_addon_base_deterministic_session_gc-13.0.1.0.1.dev2-py3-none-any.whl

Download URL odoo13_addon_base_deterministic_session_gc-13.0.1.0.1.dev2-py3-none-any.whl
Size 26.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
57ef0260d0762d8de816922c80309d796e56ce5f42673a162bce5557168c5ac4
BLAKE2b-256 checksum
How to use checksums
6e7017809f28846c8cdaaffc7320e9edad7d5468857d67b77d90696554ca493c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.5

Security for odoo13-addon-base-deterministic-session-gc 13.0.1.0.1.dev2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page