Allow resetting stat_cache from Hack (#8459)
Summary:
We'd like to enable the stat_cache, but are worried about any drift of the in-memory view of the stat_cache with what's on disk.
Background on our deploy:
• We rsync files onto the we serving hosts into A or B directory, and flip the serving root back and forth.
• We drain each host on deploy, and then run a quick warm up script
• We do not restart hhvm between deploys
• We do no currently run with the stat_cache
What we'd like:
• We'd like to enable the stat_cache in prod and clear the cache on each deploy without restarting hhvm (operationally, this is complicated, although we do aim to do that this year before switching to repo auth)
• On each deploy, we'll run a script before putting traffic on the server, which would call clearstatcache()
We're looking for feedback on this approach, or any hints of alternate ways to solve this. To be clear, we've not seen any problems with the StatCache, we're just nervous at the risk that it gets out of sync on deploy.
Additionally, we're not quite sure when it's safe to reset the stat_cache, so we defer that until the requestInit function, partially because of the comment that the work in StatCache::requestInit() that must be done before ExecutionContext::requestInit. https://github.com/facebook/hhvm/blob/HHVM-3.30/hphp/runtime/base/program-functions.cpp#L2617
Thanks!
Pull Request resolved: https://github.com/facebook/hhvm/pull/8459
Reviewed By: fredemmott
Differential Revision:
D14353058
Pulled By: alexeyt
fbshipit-source-id:
e55ff873746171f14c3454b6e248ea6a22f5469e