Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz@gitlab.com>2018-01-23 16:34:09 +0300
committerGrzegorz Bizon <grzegorz@gitlab.com>2018-01-23 16:34:09 +0300
commit90d0396d8344715bf3b326c81169883ce9b3d560 (patch)
treeee274ef241065e5fa42887a23414ee4654e8cb9b
parent51ce175a8a7e33014ae32a7c0537178bad893b51 (diff)
parentd9927162a3f17f025bad593fc7a7a1b253719244 (diff)
Merge branch 'prevent-high-sierra-fork-crash' into 'master'
Prevent Unicorn crashing in development on macOS See merge request gitlab-org/gitlab-ce!16649
-rw-r--r--config/unicorn.rb.example.development13
1 files changed, 13 insertions, 0 deletions
diff --git a/config/unicorn.rb.example.development b/config/unicorn.rb.example.development
index 3cd00d53a15..0df028648d1 100644
--- a/config/unicorn.rb.example.development
+++ b/config/unicorn.rb.example.development
@@ -1,2 +1,15 @@
worker_processes 2
timeout 60
+
+before_fork do |server, worker|
+ if /darwin/ =~ RUBY_PLATFORM
+ require 'fiddle'
+
+ # Dynamically load Foundation.framework, ~implicitly~ initialising
+ # the Objective-C runtime before any forking happens in Unicorn
+ #
+ # From https://bugs.ruby-lang.org/issues/14009
+ Fiddle.dlopen '/System/Library/Frameworks/Foundation.framework/Foundation'
+ end
+end
+