Skip to content

Commit

Permalink
Merge branch 'pid-control-thread' of git://github.com/MSP-Greg/puma i…
Browse files Browse the repository at this point in the history
…nto MSP-Greg-pid-control-thread
  • Loading branch information
nateberkopec committed Nov 30, 2020
2 parents 7e8b29e + 3966302 commit 7188ec8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
11 changes: 6 additions & 5 deletions lib/puma/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def start_control

control.binder.parse [str], self, 'Starting control server'

control.run
control.run thread_name: 'control'
@control = control
end

Expand All @@ -85,10 +85,11 @@ def output_header(mode)
min_t = @options[:min_threads]
max_t = @options[:max_threads]

log "Puma starting in #{mode} mode..."
log "* Version #{Puma::Const::PUMA_VERSION} (#{ruby_engine}), codename: #{Puma::Const::CODE_NAME}"
log "* Min threads: #{min_t}, max threads: #{max_t}"
log "* Environment: #{ENV['RACK_ENV']}"
log "Puma starting in #{mode} mode...\n" \
"* Version #{Puma::Const::PUMA_VERSION} (#{ruby_engine}), codename: #{Puma::Const::CODE_NAME}\n" \
"* Min threads: #{min_t}, max threads: #{max_t}\n" \
"* Environment: #{ENV['RACK_ENV']}\n" \
"* Pid: #{Process.pid}"
end

def redirected_io?
Expand Down
4 changes: 2 additions & 2 deletions lib/puma/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def pool_capacity
# up in the background to handle requests. Otherwise requests
# are handled synchronously.
#
def run(background=true)
def run(background=true, thread_name: 'server')
BasicSocket.do_not_reverse_lookup = true

@events.fire :state, :booting
Expand Down Expand Up @@ -255,7 +255,7 @@ def run(background=true)

if background
@thread = Thread.new do
Puma.set_thread_name "server"
Puma.set_thread_name thread_name
handle_servers
end
return @thread
Expand Down

0 comments on commit 7188ec8

Please sign in to comment.