Please sign in to comment.
Fix race when calling `HH\facts_parse` in multiple requests
Summary: Problem: - each call tries to allocate pool_size workers - we allocate a hackc on thread enter - we deallocate the hackc when we deallocate the worker object - this happens after all threads are finished - this means that at some point, we must have the entire pool of hackc workers - if two requests get any, no-one gets all Fix: - deallocate each hackc when the thread finishes its' work Thanks to @vladima for the help fixing this. Fixes #8259 Test plan: ```Hack <?hh HH\facts_parse('/', [__FILE__], /* force_hh = */ false, /* multithreaded = */ true); echo "factsparse test\n"; ``` ``` ~/code/hhvm/hphp/hhvm/hhvm --no-config -m server -p 8080 ``` ``` $ curl http://localhost:8080/test.php factsparse test $ ab -c 100 -n 1000 http://localhost:8080/test.php ``` This previously reliably deadlocked with `-c 2 -n 10`
- Loading branch information...
Showing with 9 additions and 0 deletions.