-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
puma keeps writing to the logrotated file, even after being issued a phased-restart #1962
Comments
Thanks. Sounds like you're dealing with #1842. If you think you are not (if 3.11 exhibits the same behavior for example, you are not experiencing the same issue), please reopen. |
Thanks @nateberkopec ... I'll keep an eye on the discussion on #1842 somehow missed it. Didn't test 3.11, but 3.12 works fine for us for a while. Upgrading to 4.x so far always caused issues. |
Reopening with #1842 (comment) |
Thanks for re-opening. I think this is pretty much the same as #1988 |
I updated the repo at https://github.com/gingerlime/puma-test-socket to include the logrotate issue. At least parts of it... After logrotate (using phased-restart), the logs keep being written to the rotated log file (puma.log.1), and the new file is empty... I couldn't reproduce this other weird error with |
hmm... the logrotate issue seems to also happen with 3.12 so perhaps it's unrelated. |
using latest master resolves the restart issues for me, but the logrotate issue still exists. see https://github.com/gingerlime/puma-test-socket for details how to reproduce (even after using latest master in Gemfile) What I essentially see is that puma keeps writing to the logrotated file, even after being issued a phased-restart. |
To be fair, I think this issue existed in 3.x so perhaps the title is misleading at this point, if we want to focus on the logs... Happy to change the title and/or open a separate issue. |
No problem. Title changed. |
@gingerlime what does your logrotate config look like? Rather than have logrotate restart puma, we use |
@mcg The logrotate file is included in the repo https://github.com/gingerlime/puma-test-socket/blob/master/logrotate. It doesn't use |
Found #880 (comment) So I guess we can close it as duplicate? although I still wonder if puma can re-open log files on phased restart (or maybe I'm missing something here). |
@gingerlime Ah. Missed that. Anyhow, if you need a workaround that doesn't require restarts this works well for us:
|
Thanks @mcg! I'm a bit embarrassed that it didn't occur to me. I guess in the midst of the restart issues, I didn't even stop to wonder and immediately bundled those two issues together. Later on, even after realising it's not connected and also existed with 3.x somehow I still couldn't connect the dots. This definitely seems like an appropriate -- and simple -- solution. But still the puma behaviour feels unexpected to me. Happy to close this though. It's definitely not new. |
Sorry, it's not the best bug report, I know. I hope to be able to troubleshoot and provide more details, but hope it's still something ... We've been trying to upgrade our puma 3.x since 4.0 came out, but we noticed some issues every time... The latest release looked promising, but sadly we still experienced some trouble.
Steps to reproduce
This is very tricky, because this bug seems to appear after some time, and we can't pinpoint exactly what's causing it... given the issues however, our staging system isn't stable, and therefore I only have limited access to our staging environment to be able to reproduce it, which makes it even harder.
We're seeing issues that might relate to
logrotate
and/or when reloading or restarting puma. In some cases a restart will seem to work (puma processes are there), but no socket file is created, or it "goes missing". In other cases (probably related tologrotate
), it looks like the reload process doesn't work properly? (we're seeing "older" assets returned for example)snippet from puma.log (sanitized slightly).
snippet from nginx error.log after restarting
systemd puma.socket
systemd puma.service
puma.rb
logrotate script runs
systemctl reload puma.service
Expected behavior
No weirdness :)
Actual behavior
It's complicated ...
System configuration
Ruby version: 2.5.3
Rails version: 5.2.3
Puma version: 4.1.1
The text was updated successfully, but these errors were encountered: