Skip to content
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

Prepare the GraphQL service for the switching to async methods #2334

Merged
merged 5 commits into from
Oct 14, 2024

Conversation

xgreenx
Copy link
Collaborator

@xgreenx xgreenx commented Oct 11, 2024

To avoid blocking all threads with heavy sync requests to the database, we decided to move the main database lookups to a separate thread pool.

After we introduced ReadView in the GraphQL service, we duplicated all ports for this type to avoid breaking many places in the codebase(plus simplifying the review process of the change that caused the creation of ReadView). But after adding the ReadView type, we don't need ports on this type anymore since it is an internal database wrapper type of the GraphQL service, and it has full control over how it works. So, it was an old tech debt to remove the usage of ports. The time is come. To simplify the introduction of the async and not affect ports with it, this PR decouples ports and ReadView.

This PR prepares the switching from sync to async logic(it will be a follow-up PR).

Before requesting review

  • I have reviewed the code myself

@xgreenx xgreenx requested a review from a team October 11, 2024 17:39
@xgreenx xgreenx self-assigned this Oct 11, 2024
netrome
netrome previously approved these changes Oct 12, 2024
Copy link
Contributor

@netrome netrome left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice simplifications. It's good to get rid of all these extra traits and instead define the getters directly on the ReadView.

rymnc
rymnc previously approved these changes Oct 14, 2024
Copy link
Member

@rymnc rymnc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ty 🙏

@xgreenx xgreenx dismissed stale reviews from rymnc and netrome via 7cb4231 October 14, 2024 06:37
@xgreenx xgreenx force-pushed the feature/prepare-graphql-for-async branch from 7cb4231 to ab5e940 Compare October 14, 2024 06:48
@xgreenx xgreenx requested review from netrome and rymnc October 14, 2024 06:49
Copy link
Member

@rymnc rymnc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, can we test this with wallets/sdk in devnet to ensure that any behaviour they have won't change? I'm aware this is an internal change, but we need to see if there is a performance regression/improvement with consumers of the api

@xgreenx xgreenx enabled auto-merge (squash) October 14, 2024 07:29
@xgreenx xgreenx merged commit f37f73d into master Oct 14, 2024
30 of 31 checks passed
@xgreenx xgreenx deleted the feature/prepare-graphql-for-async branch October 14, 2024 09:24
@xgreenx xgreenx restored the feature/prepare-graphql-for-async branch October 14, 2024 10:07
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.

3 participants