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

feat(graphcache): Remove refLock and add dirtyKeys / skip GC runs in unsettled states #2862

Merged
merged 1 commit into from
Dec 7, 2022

Conversation

kitten
Copy link
Member

@kitten kitten commented Dec 6, 2022

Summary

This skips GC runs when we previously would've used refLock to skip over entities that are "locked" by optimistic and deferred layers. Instead, we now simply skip GC runs when optimisticOrder is non-empty, meaning that we simply forgo garbage collection runs when we know it's unlikely we'll need them.

The motivation of this change is to reduce the complexity of InMemoryData code further, and to remove the added work and event loop pressure by scheduling garbage collection runs when we could simply wait a bit longer to schedule it.

Set of changes

  • Remove refLock from data
  • Add dirtyKeys instead, to track layers we've created
  • Update tests to ignore skipped optimistic runs
  • Simplify the GC, RC, and writeLink code

@kitten kitten force-pushed the feat/skip-gc-runs branch 2 times, most recently from 91f2595 to 6e7c493 Compare December 6, 2022 18:40
Base automatically changed from fix/deferred-layer-deadlock to main December 7, 2022 12:32
…unsettled state

This skips GC runs when we previously would've used `refLock` to skip over
entities that are "locked" by optimistic and deferred layers. Instead, we
now simply skip GC runs when `optimisticOrder` is non-empty, meaning that
we simply forgo garbage collection runs when we know it's unlikely we'll
need them.
@kitten kitten force-pushed the feat/skip-gc-runs branch from 6e7c493 to e359593 Compare December 7, 2022 12:41
@kitten kitten marked this pull request as ready for review December 7, 2022 12:41
@kitten kitten merged commit 02d6d96 into main Dec 7, 2022
@kitten kitten deleted the feat/skip-gc-runs branch December 7, 2022 12:44
@github-actions github-actions bot mentioned this pull request Dec 7, 2022
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.

2 participants