In runqueu.sh, drupal_static_reset(NULL); is called. At https://api.drupal.org/api/drupal/includes%21bootstrap.inc/function/drup... it advises that 'Resetting all variables should only be used, for example, for running unit tests with a clean environment.' Comments there mention 'It is probably never a good idea to call this function without a name. In theory it should be a safe operation, but in reality a lot of modules will freak out if their static variables go missing' & 'Modules often use drupal_static to keep track of data from multiple calls to the same function in the current request.'

In light of this, is calling drupal_static_reset(NULL); likely to cause any problems?

Comments

Anonymous’s picture

rhclayto created an issue. See original summary.

drumm’s picture

Status: Active » Closed (works as designed)

That is a user-supplied comment, not official documentation. I’ve used drupal_static_reset(NULL) in a good variety of contexts and never had an issue. Maybe a module could have a bad implementation and have issues. The alternative, static caches continually growing until runqueue.sh runs out of memory is certainly worse.