Skip to content

A platform for community discussion. Free, open, simple.

DEV: ensure we never fork v8 contexts from unicorn

Sam Saffron76173dea8711
diff --git a/config/unicorn.conf.rb b/config/unicorn.conf.rb
index e6e2d616b48..85b28005f5a 100644
--- a/config/unicorn.conf.rb
+++ b/config/unicorn.conf.rb
@@ -69,6 +69,9 @@ before_fork do |server, worker|
Discourse.git_branch
Discourse.full_version
+ # V8 does not support forking, make sure all contexts are disposed
+ ObjectSpace.each_object(MiniRacer::Context) { |c| c.dispose }
+
# get rid of rubbish so we don't share it
GC.start