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

Log the current time when Puma shuts down. #549

Merged
merged 1 commit into from
Oct 16, 2014
Merged

Log the current time when Puma shuts down. #549

merged 1 commit into from
Oct 16, 2014

Conversation

bsnape
Copy link
Contributor

@bsnape bsnape commented Jul 1, 2014

Hi,

My team occasionally observe Puma shutting down in our CI environment. We can't see any strange behaviour in the logs so we think that the process is being killed somehow.

We think that logging when Puma shuts down will help us investigate further.

Currently, Puma logs the time when it starts:

=== puma startup: 2014-06-27 13:13:48 +0100 ===

but not when it shuts down:

- Gracefully stopping, waiting for requests to finish
- Goodbye!

This simple patch fixes that (tested locally), and looks like this:

- Gracefully stopping, waiting for requests to finish
- Puma shutdown: 2014-07-01 14:13:10 +0100
- Goodbye!

Many thanks,
Ben

@seuros
Copy link

seuros commented Jul 1, 2014

👍

@seuros
Copy link

seuros commented Jul 1, 2014

What about having it === puma shutdown: 2014-07-01 14:13:10 +0100 === ?

@bsnape
Copy link
Contributor Author

bsnape commented Jul 1, 2014

Sure! Whatever works for you.

Just pushed the change. 👍

@bsnape
Copy link
Contributor Author

bsnape commented Jul 2, 2014

@seuros please can this be merged in now?

@seuros
Copy link

seuros commented Jul 2, 2014

cc @evanphx

@evanphx
Copy link
Member

evanphx commented Jul 2, 2014

The message should go the same place as the start message, which is not via #log, as that goes to stdout.

@nateless
Copy link

@bsnape, did you find the problem? I think our issue #554, can be related.

@bsnape
Copy link
Contributor Author

bsnape commented Jul 15, 2014

Hey @nateless, sorry I got sidetracked by other things at work but I'm happy to get this moving again.

I was a little confused by @evanphx 's reply as it looks like there is a single startup message:

STDOUT.puts "=== puma startup: #{Time.now} ==="

But two different shutdown messages (both STDOUT and log):

https://github.com/puma/puma/search?q=goodbye&type=Code

Should those be reconciled or am I barking up the wrong tree?

As I said, happy to get this moving again as it will be useful for myself and others.

evanphx added a commit that referenced this pull request Oct 16, 2014
Log the current time when Puma shuts down.
@evanphx evanphx merged commit c665330 into puma:master Oct 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants