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

GraphQl Config (SchemaStiching) does not use LockGuardedCacheLoader (Expensive and large config) #39494

Open
5 tasks
steven-hoffman-jomashop opened this issue Dec 18, 2024 · 1 comment
Labels
Issue: ready for confirmation Reported on 2.4.8-beta1 Indicates original Magento version for the Issue report. Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it

Comments

@steven-hoffman-jomashop

Preconditions and environment

Code on 2.4.8-beta1 shows no use of LockGuardedCacheLoader for GraphQl Config Data.

See GraphQl di.xml
For uses see:

This can lead to a 'stampede' type issue for the expensive schema stitching process. By using the LockGuardedCacheLoader, we can prevent this issue when the cache is flushed.

Other notes:

  • LockGuardedCacheLoader should consider supporting different setting for allow_parallel_generation per usage.
  • Most of the expensive parts of schema stitching can be done with di compile. (And the product/other fields merged in as currently done).

Steps to reproduce

  • Clear cache (Or just remove zc:k:{id}_MAGENTO_FRAMEWORK_GRAPHQLSCHEMASTITCHING_CONFIG_DATA)
  • Make 10x GraphQl requests at once / in quick succession.

Expected result

GraphQl schema stitching is only loaded once. (Or F times where F is some small fraction of N; this would mitigate against one process failing).

Actual result

GraphQl schema stitching is run once per request.

Additional information

You can see this effect by monitoring Redis

# Local test instance
$ redis-cli MONITOR | grep -i _MAGENTO_FRAMEWORK_GRAPHQLSCHEMASTITCHING_CONFIG_DATA | cut -c -150
1734554861.066657 [0 10.0.2.2:63558] "hget" "zc:k:ABCD_MAGENTO_FRAMEWORK_GRAPHQLSCHEMASTITCHING_CONFIG_DATA" "d"
1734554861.068282 [0 10.0.2.2:63562] "hget" "zc:k:ABCD_MAGENTO_FRAMEWORK_GRAPHQLSCHEMASTITCHING_CONFIG_DATA" "d"
1734554861.082297 [0 10.0.2.2:63566] "hget" "zc:k:ABCD_MAGENTO_FRAMEWORK_GRAPHQLSCHEMASTITCHING_CONFIG_DATA" "d"
1734554861.135661 [0 10.0.2.2:63572] "hget" "zc:k:ABCD_MAGENTO_FRAMEWORK_GRAPHQLSCHEMASTITCHING_CONFIG_DATA" "d"
1734554861.141448 [0 10.0.2.2:63576] "hget" "zc:k:ABCD_MAGENTO_FRAMEWORK_GRAPHQLSCHEMASTITCHING_CONFIG_DATA" "d"
1734554861.799215 [0 10.0.2.2:63580] "hget" "zc:k:ABCD_MAGENTO_FRAMEWORK_GRAPHQLSCHEMASTITCHING_CONFIG_DATA" "d"
1734554862.930618 [0 10.0.2.2:63576] "hget" "zc:k:ABCD_MAGENTO_FRAMEWORK_GRAPHQLSCHEMASTITCHING_CONFIG_DATA" "t"
1734554862.931542 [0 10.0.2.2:63558] "hget" "zc:k:ABCD_MAGENTO_FRAMEWORK_GRAPHQLSCHEMASTITCHING_CONFIG_DATA" "t"
1734554862.931873 [0 10.0.2.2:63562] "hget" "zc:k:ABCD_MAGENTO_FRAMEWORK_GRAPHQLSCHEMASTITCHING_CONFIG_DATA" "t"
1734554862.932389 [0 10.0.2.2:63572] "hget" "zc:k:ABCD_MAGENTO_FRAMEWORK_GRAPHQLSCHEMASTITCHING_CONFIG_DATA" "t"
1734554862.932648 [0 10.0.2.2:63566] "hget" "zc:k:ABCD_MAGENTO_FRAMEWORK_GRAPHQLSCHEMASTITCHING_CONFIG_DATA" "t"
1734554862.933038 [0 10.0.2.2:63580] "hget" "zc:k:ABCD_MAGENTO_FRAMEWORK_GRAPHQLSCHEMASTITCHING_CONFIG_DATA" "t"
1734554862.955289 [0 10.0.2.2:63576] "hmset" "zc:k:ABCD_MAGENTO_FRAMEWORK_GRAPHQLSCHEMASTITCHING_CONFIG_DATA" "d" "{\"Query\":{\"name\":\"Query\",\"ty
1734554862.968716 [0 10.0.2.2:63576] "sadd" "zc:ti:ABCD_CONFIG" "ABCD_MAGENTO_FRAMEWORK_GRAPHQLSCHEMASTITCHING_CONFIG_DATA"
1734554862.968721 [0 10.0.2.2:63576] "sadd" "zc:ti:ABCD_MAGE" "ABCD_MAGENTO_FRAMEWORK_GRAPHQLSCHEMASTITCHING_CONFIG_DATA"
1734554862.973511 [0 10.0.2.2:63566] "hmset" "zc:k:ABCD_MAGENTO_FRAMEWORK_GRAPHQLSCHEMASTITCHING_CONFIG_DATA" "d" "{\"Query\":{\"name\":\"Query\",\"ty
1734554862.987830 [0 10.0.2.2:63566] "sadd" "zc:ti:ABCD_CONFIG" "ABCD_MAGENTO_FRAMEWORK_GRAPHQLSCHEMASTITCHING_CONFIG_DATA"
1734554862.987835 [0 10.0.2.2:63566] "sadd" "zc:ti:ABCD_MAGE" "ABCD_MAGENTO_FRAMEWORK_GRAPHQLSCHEMASTITCHING_CONFIG_DATA"
1734554862.993475 [0 10.0.2.2:63580] "hmset" "zc:k:ABCD_MAGENTO_FRAMEWORK_GRAPHQLSCHEMASTITCHING_CONFIG_DATA" "d" "{\"Query\":{\"name\":\"Query\",\"ty
1734554863.007311 [0 10.0.2.2:63580] "sadd" "zc:ti:ABCD_CONFIG" "ABCD_MAGENTO_FRAMEWORK_GRAPHQLSCHEMASTITCHING_CONFIG_DATA"
1734554863.007315 [0 10.0.2.2:63580] "sadd" "zc:ti:ABCD_MAGE" "ABCD_MAGENTO_FRAMEWORK_GRAPHQLSCHEMASTITCHING_CONFIG_DATA"
1734554863.011244 [0 10.0.2.2:63572] "hmset" "zc:k:ABCD_MAGENTO_FRAMEWORK_GRAPHQLSCHEMASTITCHING_CONFIG_DATA" "d" "{\"Query\":{\"name\":\"Query\",\"ty
1734554863.024044 [0 10.0.2.2:63572] "sadd" "zc:ti:ABCD_CONFIG" "ABCD_MAGENTO_FRAMEWORK_GRAPHQLSCHEMASTITCHING_CONFIG_DATA"
1734554863.024048 [0 10.0.2.2:63572] "sadd" "zc:ti:ABCD_MAGE" "ABCD_MAGENTO_FRAMEWORK_GRAPHQLSCHEMASTITCHING_CONFIG_DATA"
1734554863.024270 [0 10.0.2.2:63562] "hmset" "zc:k:ABCD_MAGENTO_FRAMEWORK_GRAPHQLSCHEMASTITCHING_CONFIG_DATA" "d" "{\"Query\":{\"name\":\"Query\",\"ty
1734554863.036918 [0 10.0.2.2:63562] "sadd" "zc:ti:ABCD_CONFIG" "ABCD_MAGENTO_FRAMEWORK_GRAPHQLSCHEMASTITCHING_CONFIG_DATA"
1734554863.036922 [0 10.0.2.2:63562] "sadd" "zc:ti:ABCD_MAGE" "ABCD_MAGENTO_FRAMEWORK_GRAPHQLSCHEMASTITCHING_CONFIG_DATA"

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Copy link

m2-assistant bot commented Dec 18, 2024

Hi @steven-hoffman-jomashop. Thank you for your report.
To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce.


Join Magento Community Engineering Slack and ask your questions in #github channel.
⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
🕙 You can find the schedule on the Magento Community Calendar page.
📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

@github-project-automation github-project-automation bot moved this to Ready for Confirmation in Issue Confirmation and Triage Board Dec 18, 2024
@engcom-Bravo engcom-Bravo added Reported on 2.4.8-beta1 Indicates original Magento version for the Issue report. Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it labels Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: ready for confirmation Reported on 2.4.8-beta1 Indicates original Magento version for the Issue report. Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
Projects
Status: Ready for Confirmation
Development

No branches or pull requests

2 participants