-
Notifications
You must be signed in to change notification settings - Fork 441
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
Cache redesign part 1: Don't remove expired objects #739
Comments
@heathergreerklein and I discussed this yesterday and have decided to schedule first part for beta4 & assign to @artlowel. Work can begin as soon as beta3 is complete (i.e. likely as soon as next week) |
As discussed in today's meeting, this ticket & #740 are both assigned to @artlowel for the Atmire team to complete (in parallel to the effort to upgrade to Angular 10, see #787 ). This ticket is deemed as |
Time spent so far: 91 hours |
References
This ticket corresponds to issues 1, 2, 3, 4 and 6 from #718.
That ticket was too big to tackle at once so we split it up in to smaller, more manageable chunks of work.
The first two were deemed the most critical to address ASAP. As they leave dspace 7 fundamentally broken.
The others in this ticket will be addressed at the same time because their solutions are very closely tied to the solution for the first two.
Description
When an object's cache time to live (TTL) has elapsed. It is automatically removed from the cache
It is unclear for a component developer that this has happened and how to deal with it when it does.
As a consequence if you leave a dspace 7 page open in your browser, without doing anything for more than 15 minutes, more and more things will start to break. If you wait long enough the app may stop working entirely, depending on the page. This is a bug that can not be left unresolved.
Responses and objects are cached in separate parts of the store and have separate TTL.
But both the response and the object are necessary when we need the object in a component. If you mix requests with long and short TTLs for the same objects these can get out of sync, where the response is still valid, but the object isn't anymore. The result is hard to diagnose issues in the UI. These occur often when working with the submission and mydspace due to the very short cache times in use there.
Due to this issue a request made by component A can break another unrelated component B simply because the response for A contains the an object B was using. This is also a high prio issue to address.
An object can be removed from the cache before it's been used once.
If you use a very short TTL (a few ms) it's perfectly possible that the object is already removed by the time you first try to render it, in the best case this results in pages that sometimes work, sometimes don't (if the processing takes slightly too long), or in the worst case: infinite loops of requests.
RemoteDataObjects are constructed every time they're needed.
To construct them we combine info from the response and the object cache, have some logic to determine the state, but that logic basically duplicates what we already do when parsing a request, but doesn't work exactly te same way, which leads to issues: e.g. a RemoteDataObject isn't deemed to be successful if it has no payload, but if the response was a 204 that's incorrect. Constructing them when needed also leads to long, hard to debug methods, and takes up resources.
We can't take advantage of an embedded lists of objects
because lists aren't cached in the object cache, but stored as part of the response. Only lists that were requested using their self link can be cached at the moment.
Proposed solution
To deal with these issues I propose we do the following:
stale
.page
link to the paginated list's _links section. It will contain HALLinks to every object in the list.tap()
to the bottom of any dataservice method that represents a GET request,tap()
will ensure that this re-request will only happen if something is still subscribed to the result, i.e. when it's still being used.This will take an estimated 60 - 80h
The text was updated successfully, but these errors were encountered: