Needs work
Project:
Drupal core
Version:
main
Component:
cache system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 May 2014 at 16:33 UTC
Updated:
31 May 2026 at 07:40 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
sunapcu.patch queued for re-testing.
Comment #3
olli commentedReroll for psr-4 and a test only patch.
Comment #6
dawehnerCan we use a non-short variable name?
Not sure whether I am convinced of using apc_store not $this->set tbh.
Comment #7
sun$ttlis fine as variable name (see TTL).2. sounds minor to me?
@olli: Any chance you could revise the issue title + summary to better explain what this issue/patch is actually about? :)
Comment #8
olli commentedThanks for the reviews. Can't use set there because that would recalculate the deletions checksum. I've added coverage for this. The ::invalidateMultiple() was wrong using getMultiple/apc_store, fixed by replacing getMultiple with apc_fetch.
Comment #11
olli commentedComment #12
olli commentedMerged #2267643: Cache\PhpBackend::deleteTags() does not remove invalid items
Comment #13
sunHm. AFAIK,
APCIteratordoes not immediately fetch all data from the store, it only fetches when iterating over the items.By passing the iterator directly to
apc_delete(), all currently stored items are not fetched, but directly deleted.Comment #14
sunSorry, please ignore #13 —
getAll()returns anAPCIterator.Comment #15
olli commentedWe could rename getAll() to getIterator() or something.
Comment #16
olli commentedI think we need to check the return value of apc_fetch() here too.
Comment #17
olli commentedReroll and a check for the return value of apc_fetch (like in #2332427: APCUBackend makes incorrect assumptions about apc_fetch return type.).
Comment #18
berdirI think #918538: Decouple cache tags from cache bins means that a lot here will no longer be needed? Btw, would be great if you review that, you seem to be finding a lot of bugs in the cache backends :)
Comment #19
berdirThat landed, so this needs a reroll
Comment #20
olli commentedHere's a reroll.
Comment #21
berdirComment #22
olli commentedreroll
Comment #23
alexpottI think we shouldn't we be setting the ttl time on APC cache entries. We should leave this for the user to configure in their APC settings. The idea of setting ttl's for invalidations seems wrong too because invalidations are handled by the expire time set on the cache object. The default ttl for user cache objects is 0 - which means they are permanent.
Also the whole point of invalidations is so we can use
$allow_invalidso setting the ttl to 1 breaks this.The only reason this is not a major bug is because we have no usages of
$allow_invalidin core.Garbage collection and APC is also interesting since many people run cron using cron and therefore this process will not have access to the APC cache used by the web server. This suggests that the whole tactic of allow invalid might actually not be sensible for an APC backend.
Comment #27
fabianx commentedI don't think ACPu needs garbage collection, but yes allow_invalid is incompatible with that and need to check timestamp ourselves there - the same as we check the tags.
Comment #36
berdir*Berdir casts a reroll spell, puts on his +2 git skills gloves and rolls the dice...*
Found this due to #2575105: Use cache collector for state, we actually do have a usage of cache invalidation in core, just not one using fast chained/apcu I suppose. Until that state patch, that is.
Comment #37
andypostGreat to see tests!
getAll()using different logic to implement prefix, but looks that's fine...Comment #38
berdirThis seems to cause a massive performance issue as the test is aborted after 110min, is that the garbage collection?
Comment #43
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #46
catchSome crossover here with #3586418: Set explicit ttl in the apcu backend and allow a default to be set for chained fast although that issue is setting artificially short TTLs to avoid having any kind of explicit garbage collection step.