Skip to content

Graphql Subscription query type #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: 18.0
Choose a base branch
from
Open

Graphql Subscription query type #45

wants to merge 2 commits into from

Conversation

divad1196
Copy link
Owner

This is currently just a PoC.

The main challenge was to find a way to check for the changes in an efficient way.
Using 2 requests per query depths, we limit the performance impact.

NOTE:
The time complexity is O(n) where n is the depth of the query, not the number of elements.
The number of elements does theoretically have an impact, but it's neglectable compared to the IO impact on time.

A code refactoring should be done as many features were added "on the spot".

Issues and limitations

Non specific change

A new result is sent whenever an object is changed even though it didn't impact the result (e.g. we changed field A but we don't use it in the query).
This part can be done by computing and checking hashes based only on the requested fields.

Computed fields

We cannot detect changes on computed, non stored, fields as they don't change the write_date field. This limitation applies to all Odoo, there is nothing we can do except manually monitor it which could be disastrous in terms of performance.

Worker Pool Starvation => Server Crash (?)

All implementation will systematically keep the worker open which could lead to "worker pool starvation": all workers are used, therefore Odoo cannot receive any other request.

I still need to confirm exactly the behavior but it's hard to imagine a stable solution for it.
I also need to experiment if this is still an issue with the latest version of Odoo, it's possible that now workers are able to take an unlimited number of requests.

@divad1196 divad1196 force-pushed the 18.0_subscription branch from f5114dd to a1e8177 Compare July 6, 2025 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant