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

unlink UNIXSocket files, fix Binder#close #1970

Merged
merged 1 commit into from Sep 18, 2019

Conversation

MSP-Greg
Copy link
Member

See PR #1886, etc. Tests to follow after lib file PR's.

@MSP-Greg
Copy link
Member Author

I think a 'perfect storm' happened on Travis, in that every intermittent test failed...

@nateberkopec
Copy link
Member

AFAICT in your PRs theres still no test anywhere that paths are removed after stop, is that correct? We need that test.

@MSP-Greg
Copy link
Member Author

MSP-Greg commented Sep 17, 2019

I've got an update for PR #1965 that I just pushed...

def teardown
if defined?(@server) && @server
stop_server @pid, signal: :INT
end
@ios_to_close.each do |io|
io.close if io.is_a?(IO) && !io.closed?
io = nil
end
refute File.exist?(@bind_path), "Bind path must be removed after stop"
File.unlink(@bind_path) rescue nil
# wait until the end for OS buffering?
if defined?(@server) && @server
@server.close unless @server.closed?
@server = nil
end
end

@nateberkopec
Copy link
Member

Merging with the understanding that tests are in the other PR.

Closes #1842 #1842 (comment)

@nateberkopec nateberkopec merged commit db74ad4 into puma:master Sep 18, 2019
@MSP-Greg MSP-Greg deleted the unlink-unix-binder-close branch September 18, 2019 15:50
@rromanchuk
Copy link

Why did i open my mouth... ugghh. On second deploy lol

Sep 19 22:05:19 web_worker2-0cd ansible-systemd[12153]: Invoked with no_block=False force=None name=puma.service enabled=None daemon_reload=False state=restarted masked=None scope=None user=None
Sep 19 22:05:19 web_worker2-0cd systemd[1]: Stopping Puma HTTP Server...
-- Subject: Unit puma.service has begun shutting down
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Unit puma.service has begun shutting down.
Sep 19 22:05:19 web_worker2-0cd puma[31897]: [31897] - Gracefully shutting down workers...
Sep 19 22:05:19 web_worker2-0cd puma[31897]: On worker shutdown...
Sep 19 22:05:19 web_worker2-0cd puma[31897]: On worker shutdown...
Sep 19 22:05:19 web_worker2-0cd puma[31897]: On worker shutdown...
Sep 19 22:05:19 web_worker2-0cd nginx[5011]: web_worker2-0cd nginx:  - - [19/Sep/2019:22:05:19 +0000] "GET /cable HTTP/1.1" 101 13306 "-" "-"
Sep 19 22:05:19 web_worker2-0cd systemd[1]: Stopped Puma HTTP Server.
-- Subject: Unit puma.service has finished shutting down
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Unit puma.service has finished shutting down.
Sep 19 22:05:19 web_worker2-0cd systemd[1]: Started Puma HTTP Server.
-- Subject: Unit puma.service has finished start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Unit puma.service has finished starting up.
-- 
-- The start-up result is RESULT.
Sep 19 22:05:19 web_worker2-0cd sudo[12151]: pam_unix(sudo:session): session closed for user root
Sep 19 22:05:20 web_worker2-0cd puma[12159]: % Registered unix:/var/www/spar/shared/tmp/sockets/puma.sock for activation from LISTEN_FDS
Sep 19 22:05:20 web_worker2-0cd puma[12159]: [12159] Puma starting in cluster mode...
Sep 19 22:05:20 web_worker2-0cd puma[12159]: [12159] * Version 4.1.1 (ruby 2.6.3-p62), codename: Fourth and One
Sep 19 22:05:20 web_worker2-0cd puma[12159]: [12159] * Min threads: 10, max threads: 10
Sep 19 22:05:20 web_worker2-0cd puma[12159]: [12159] * Environment: production
Sep 19 22:05:20 web_worker2-0cd puma[12159]: [12159] * Process workers: 3
Sep 19 22:05:20 web_worker2-0cd puma[12159]: [12159] * Preloading application
Sep 19 22:05:20 web_worker2-0cd sudo[12226]:   ubuntu : TTY=pts/0 ; PWD=/home/ubuntu ; USER=root ; COMMAND=/bin/sh -c echo BECOME-SUCCESS-wurzdukaruyetpdclhiqhmcqfsrgyxgj; TMP=/home/ubuntu/tmp TMPDIR=/home/ubuntu/tmp RAILS_ENV=production /usr/bin/python /home/ubuntu/.ansible/tmp/ansible-tmp-1568930720.59-270557708308645/AnsiballZ_systemd.py
Sep 19 22:05:20 web_worker2-0cd sudo[12226]: pam_unix(sudo:session): session opened for user root by ubuntu(uid=0)
Sep 19 22:05:20 web_worker2-0cd ansible-systemd[12228]: Invoked with no_block=False force=None name=nginx enabled=None daemon_reload=False state=started masked=None scope=None user=None
Sep 19 22:05:20 web_worker2-0cd sudo[12226]: pam_unix(sudo:session): session closed for user root
Sep 19 22:05:21 web_worker2-0cd nginx[5011]: web_worker2-0cd nginx: 2019/09/19 22:05:21 [crit] 5011#5011: *991790 connect() to unix:///var/www/spar/shared/tmp/sockets/puma.sock failed (2: No such file or directory) while connecting to upstream, client: , server: , request: "GET /status HTTP/1.1", upstream: "http://unix:///var/www/spar/shared/tmp/sockets/puma.sock:/status", host: 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants