Closed (outdated)
Project:
Drupal core
Version:
7.x-dev
Component:
block.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
19 Aug 2009 at 14:14 UTC
Updated:
24 Feb 2014 at 19:48 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dddave commentedWhat is the state of this in D7? Should this go against D8 or be closed?
Comment #2
nagba commentedNot sure about D8, block code seems to be very very different there. For the time being, the patch is for D7. I was playing with the idea of returning an empty array when the lock is taken instead of waiting, but then it would cause quite some complications because we would not be able to tell if we got a empty blocks because the theme does not have any, or because the lock wasnt free.
Comment #3
nagba commentedComment #4
nagba commentedthis version will include less waiting
Comment #5
pwolanin commentedIf the process waited, maybe it should just get the blocks, instead of rehashing again?
Comment #6
nagba commentedGood idea. Unfortunately the block data in the block table is not complete, some data is being pulled from the hook_block_info hooks (specifically the info key) so first we would need to fetch the data from the DB, then invoke the block_info hooks to find the missing data, then alter it to keep the result consistent. At this point it feels like we are doing too much for a quick return, practically duplicating the effort. Also we have no guarantee that every block coming from the DB will have its data properly backfilled from the hook_block_infos, because someone might have just disabled the module providing it and the rehash hasnt yet got to get rid of it.
Comment #6.0
nagba commentedtypo
Comment #7
pwolanin commentedAs written this is a potentially infinite loop? The core lock system doesn't have any notion of priority for waiting processes.
In several places core assumes that if another process is running this, we should just wait and then skip the locked code.
sadly core has the same or worse in https://api.drupal.org/api/drupal/includes%21bootstrap.inc/function/vari...
Comment #8
psynaptic commentedI think we can still do the loop and avoid the infinite loop if we set a limit to the number of iterations. Something like: