Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change director server from Thin to Puma #1800

Merged
merged 6 commits into from
Nov 6, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Ensure that puma workers get their own db connection
DB connections are disconnected before puma forks its own worker
processes. This ensures that all puma workers will get new
DB connections.

[#150958544](https://www.pivotaltracker.com/story/show/150958544)

Signed-off-by: Beyhan Veli <[email protected]>
friegger authored and beyhan committed Oct 23, 2017
commit e22b09c7d2075fa1824d112078625e7f5623b117
2 changes: 2 additions & 0 deletions src/bosh-director/bin/bosh-director
Original file line number Diff line number Diff line change
@@ -33,6 +33,8 @@ puma_configuration = Puma::Configuration.new do |user_config|
user_config.port config.port
user_config.app rack_app
user_config.preload_app!
# this makes sure that all puma workers get their own db connections
user_config.before_fork { Bosh::Director::Config.db.disconnect }
end
puma_launcher = Puma::Launcher.new(puma_configuration)

1 change: 1 addition & 0 deletions src/bosh-director/lib/bosh/director/config.rb
Original file line number Diff line number Diff line change
@@ -270,6 +270,7 @@ def configure_db(db_config)
if logger
db.logger = logger
db.sql_log_level = :debug
db.log_connection_info = true
end

db