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

Resource not found in cache #39

Open
jirenius opened this issue Jan 23, 2020 · 5 comments
Open

Resource not found in cache #39

jirenius opened this issue Jan 23, 2020 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@jirenius
Copy link
Collaborator

Issue

ResClient may, in case of high activity, give the error:

Resource not found in cache.

Even when the resource should have been available in the cache.

How to reproduce

Not yet known.

@jirenius jirenius added the bug Something isn't working label Jan 23, 2020
@CristianWesleyFront
Copy link

+1

@jirenius jirenius self-assigned this Mar 27, 2020
jirenius added a commit that referenced this issue Mar 27, 2020
…-in-cache

GH-39: Fixed bug where evict timeout isn't reset on ResClient.get.
@jirenius
Copy link
Collaborator Author

I failed to replicate the bug.

The bug that might have been the cause is that, when a cached resource is retrieved from the cache, using ResClient.get(rid), any current running eviction timeout will continue to tick.

If the resource was retrieved just moments before the timeout was reached, the resource might get evicted before the app has time to call on.

If that is the cause, then this issue is resolved in #40

If the bug is encountered again, this issue will be reopened.

@jirenius
Copy link
Collaborator Author

Reopening this issue because the bug still exists.

Probable cause

It seems to be caused by ResClient not sending an equal amount of unsubscribe requests to match the number of direct subscriptions held when unsubscribing/evicting a resource. As stated by the RES Client Specification:

It is possible to make multiple direct subscriptions on a resource. It will be considered directly subscribed until an equal number of unsubscribe requests has been made.

Even if a resource holds multiple direct subscriptions, ResClient only sends a single unsubscribe request before removing it from the cache. However, Resgate is true to the specification, and will assume the client still has the item cached.

@jirenius jirenius reopened this May 14, 2020
jirenius added a commit that referenced this issue May 14, 2020
jirenius added a commit that referenced this issue May 14, 2020
…-in-cache-v2

Bugfix/gh 39 resource not found in cache v2
@jirenius
Copy link
Collaborator Author

Resolved in #41

@jirenius
Copy link
Collaborator Author

Reopening this issue once again, as the bug still exists.
I am trying to produce full communication logs when this appears.

@jirenius jirenius reopened this Mar 21, 2021
jirenius added a commit that referenced this issue Mar 31, 2021
… if resource is not in cache, but still removes listener from eventBus.

Added debug trace logging.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants