I've encountered some complex racing conditions when trying to do massive rebuilds with features and rabbit_hole enabled. When exporting node_uuid components with rh_node enabled, it will export the entities schema fields which consist of some rh_node fields (rh_action for example). When rebuilding this in a different environment it's possible that you'll WSOD your installation because the feature is importing the rh_node entity fields while the columns have not yet been created. The result is WSOD with a massive PDOException which is not easy to repair.
To fix this up, I've written the following patch. Please review carefully, since I'm not entirely sure this is the way to go. But I do think rh_node should use it's hook_install hook to make sure it's entity fields are created before continuing.
This solution may not really scale well, since this would not fix up any other hook_rabbit_hole modules which need to update their entity schema. Though, the current rabbit_hole_modules_enabled() does not seem to be fast enough to alter the entities schema, before other modules are creating / updating / reading / deleting entities. I'm open to suggestions.
Also a small addition is a implementation for adding a dependency for rabbit_hole for exported features. When rabbit_hole is enabled and there is a node or node_uuid component exported, they will contain rabbit_hole info.
Example PDOException:
WD php: PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown [error]
11:32:21 column 'base.rh_action' in 'field list': SELECT revision.vid AS vid,
11:32:21 base.uid AS uid, revision.title AS title, revision.log AS log,
11:32:21 revision.status AS status, revision.comment AS comment,
11:32:21 revision.promote AS promote, revision.sticky AS sticky,
11:32:21 revision.vuuid AS vuuid, base.nid AS nid, base.type AS type,
11:32:21 base.language AS language, base.created AS created, base.changed AS
11:32:21 changed, base.tnid AS tnid, base.translate AS translate,
11:32:21 base.rh_action AS rh_action, base.rh_redirect AS rh_redirect,
11:32:21 base.rh_redirect_response AS rh_redirect_response, base.uuid AS uuid,
11:32:21 revision.timestamp AS revision_timestamp, revision.uid AS
11:32:21 revision_uid
11:32:21 FROM
11:32:21 {node} base
11:32:21 INNER JOIN {node_revision} revision ON revision.vid = base.vid
11:32:21 WHERE (base.nid IN (:db_condition_placeholder_0)) ; Array
11:32:21 (
11:32:21 [:db_condition_placeholder_0] => 2
11:32:21 )
11:32:21 in DrupalDefaultEntityController->load() (line 198 of
11:32:21 ***/httpdocs/includes/entity.inc).
| Comment | File | Size | Author |
|---|---|---|---|
| rabbit_hole--entity-schema-race-condition-fix.patch | 905 bytes | nvaken |
Comments
Comment #2
mparker17rabbit_hole-7.x-2.x is no longer supported, because Drupal 7 is no longer supported.
Can you confirm if this is still an issue in rabbit_hole-8.x-1.2 or rabbit_hole-2.0.0-beta2?
I'm going to mark this issue as "Postponed (maintainer needs more info)"... but when you answer, please change it back to "Active". If I don't hear anything back in 6 months, then I will mark this issue as "Closed (outdated)". Thank you in advance for your understanding and patience as I try to keep this module's issue queue clear.