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

Don't close systemd activated socket on pumactl restart #2563

Merged
merged 1 commit into from Mar 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions History.md
@@ -1,3 +1,12 @@
## Master

* Features
* Your feature goes here <Most recent on the top, like GitHub> (#Github Number)

* Bugfixes
* Your bugfix goes here <Most recent on the top, like GitHub> (#Github Number)
* Don't close systemd activated socket on pumactl restart (#2563, #2504)

## 5.2.2 / 2021-02-22

* Bugfixes
Expand Down
18 changes: 11 additions & 7 deletions lib/puma/binder.rb
Expand Up @@ -258,14 +258,18 @@ def parse(binds, logger, log_msg = 'Listening')
end

# Also close any unused activated sockets
@activated_sockets.each do |key, sock|
logger.log "* Closing unused activated socket: #{key.join ':'}"
begin
sock.close
rescue SystemCallError
unless @activated_sockets.empty?
fds = @ios.map(&:to_i)
@activated_sockets.each do |key, sock|
next if fds.include? sock.to_i
logger.log "* Closing unused activated socket: #{key.first}://#{key[1..-1].join ':'}"
begin
sock.close
rescue SystemCallError
end
# We have to unlink a unix socket path that's not being used
File.unlink key[1] if key.first == :unix
end
# We have to unlink a unix socket path that's not being used
File.unlink key[1] if key[0] == :unix
end
end

Expand Down