-
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
Print RUBY_DESCRIPTION when Puma starts #3407
Conversation
Mind showing some before and after examples? |
Current:
PR:
After the PR, the line is 127 characters wide. Splitting it to another line might be an idea, but doing so could (maybe) mess up code that is parsing it... |
Ideas/alternatives: |
|
lib/puma/runner.rb
Outdated
# @!attribute [r] ruby_engine | ||
def ruby_engine |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method is public, so we should deprecate it, not remove it.
$ ruby -rpuma -rpuma/runner -e 'p Puma::Runner.new(Puma::Launcher.new(Puma::Configuration.new)).ruby_engine'
"ruby 3.2.4-p170"
Unless this change should happen in Puma v7, but even if so, it is nice to deprecate things we intend to remove.
52a7c31
to
e5c94d3
Compare
This commit changes the runner to print `RUBY_DESCRIPTION` instead of a manually-generated string for the Ruby version. Other popular gems like Sidekiq similarly print `RUBY_DESCRIPTION`. One specific motivation for this change is that `RUBY_DESCRIPTION` indicates whether YJIT is enabled in MRI. This commit also deprecates the `Puma::Runner#ruby_engine` method, which will be removed in v7.
e5c94d3
to
0234fce
Compare
def ruby_engine | ||
warn "Puma::Runner#ruby_engine is deprecated; use RUBY_DESCRIPTION instead. It will be removed in puma v7." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$ ruby -I lib -rpuma -rpuma/runner -e 'p Puma::Runner.new(Puma::Launcher.new(Puma::Configuration.new)).ruby_engine'
Puma::Runner#ruby_engine is deprecated; use RUBY_DESCRIPTION instead. It will be removed in puma v7.
"ruby 3.3.2-p78"
@dentarg let me know what I should do to move this forward. Thanks! |
I think this makes sense. Is there any existing tests for this part of Puma that should be extended? |
I recall some change to the Puma logging in the past and I remember @nateberkopec being conservative about it. It would be great if he signed off on this. If I have time I can try to look for that past discussion. |
I didn't see any, but let me know if you think I should try to add one. |
@nateberkopec any thoughts on this? |
This change feels fairly uncontroversial to me; what can we do to move it forward? |
Maybe I misremembering, I can only find this comment #2817 (comment) and it is probably questionable to call this logging 'behavior'. We have changed the logging before in a minor release, ee3341d67, so this should be fine. I'll merge it if you rebase @JacobEvelyn |
I clicked the Update branch button so no need |
Yeah thanks for checking w/me but in this case I think we're good. |
This commit changes the runner to print
RUBY_DESCRIPTION
instead of a manually-generated string for the Ruby version. Other popular gems like Sidekiq similarly printRUBY_DESCRIPTION
. One specific motivation for this change is thatRUBY_DESCRIPTION
indicates whether YJIT is enabled in MRI.This commit also deprecates the
Puma::Runner#ruby_engine
method, which will be removed in v7.Description
My team was testing YJIT and was frustrated by the fact that Puma does not indicate whether YJIT is running, while other gems like Sidekiq do.
I welcome any suggestions for this PR.
Your checklist for this pull request
[ci skip]
to the title of the PR.#issue
" to the PR description or my commit messages.