Skip to content

Add OTP version to the startup banner #2777

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

Merged
merged 1 commit into from
Jun 24, 2021
Merged

Conversation

mkuratczyk
Copy link
Contributor

Print Erlang/OTP version after the RabbitMQ version in the startup banner. This is purely for information purposes - often users will copy-paste console output when reporting issues. This way we don't have ask about the Erlang version.

RabbitMQ 3.8.10+18.gea1f4a3.dirty, Erlang/OTP 23.2.3

@michaelklishin michaelklishin changed the title Add OTP version to the startup banner WIP Add OTP version to the startup banner Mar 2, 2021
@gerhard
Copy link
Contributor

gerhard commented Jun 17, 2021

WDYT @mkuratczyk about this proposal?

 Starting RabbitMQ 3.8.10+8.g5247909.25+stream on Erlang 23.2.3
 Copyright (c) 2007-2021 VMware, Inc. or its affiliates.
 Licensed under the MPL 2.0. Website: https://rabbitmq.com

  ##  ##      RabbitMQ 3.8.10+8.g5247909.25+stream
  ##  ##
  ##########  Copyright (c) 2007-2021 VMware, Inc. or its affiliates.
  ######  ##
  ##########  Licensed under the MPL 2.0. Website: https://rabbitmq.com

+  Erlang 23.2.3
+  Ubuntu 20.04.1 x86_64
+  OpenSSL 1.1.1f

  Doc guides: https://rabbitmq.com/documentation.html
  Support:    https://rabbitmq.com/contact.html
  Tutorials:  https://rabbitmq.com/getstarted.html
  Monitoring: https://rabbitmq.com/monitoring.html

@mkuratczyk mkuratczyk force-pushed the banner-with-otp-version branch from 3825042 to 223ad24 Compare June 22, 2021 08:16
@mkuratczyk
Copy link
Contributor Author

I can't find a way to retrieve the operating system details but I implemented the other two lines, additionally with info whether JIT is used:

  Erlang: 24.0.2 [jit]
  OpenSSL: OpenSSL 1.1.1k  25 Mar 2021

OpenSSL details look a bit funny perhaps but I just print them verbatim as returned by crypto:info_lib(). I'm not sure what this will look like with LibreSSL, on Windows, etc.

@gerhard
Copy link
Contributor

gerhard commented Jun 22, 2021

That looks good to me! I really like the [jit] addition, but it fails on Erlang 23, which we need to support:

BOOT FAILED
===========
Exception during startup:

error:badarg

    erlang:system_info/1
        args: [emu_flavor]
    rabbit:print_banner/0, line 1192
    rabbit:start/2, line 880
    application_master:start_it_old/4, line 277

The above error reminded me that we should auto-build an OCI for 23 as well as 24, because we didn't see this in 23. cc @ansd

If we decide to keep the [jit] (which I like!) then we should add it to the first line too:

2021-06-22 14:17:02.872657+00:00 [info] <0.217.0>  Starting RabbitMQ 223ad24351928941e77c38ad5ee879b8b241730a on Erlang 24.0.2 [jit]

WDYT @dumbbell, assuming that you also think it would be a good idea to do this, how can we retrieve the OS name, version & platform?

@gerhard
Copy link
Contributor

gerhard commented Jun 22, 2021

By the way, you may want to rebase this onto master to fix the 23 & 24 tests.

@mkuratczyk mkuratczyk changed the title WIP Add OTP version to the startup banner Add OTP version to the startup banner Jun 23, 2021
@mkuratczyk
Copy link
Contributor Author

mkuratczyk commented Jun 23, 2021

It should work on Erlang 23 now and the flavor (jit/emu) has been added to the log line. Test failures are unrelated. Give it a try and if it works - let's just do it. This PR has been open for too long given its scope. ;)

This is purely for information purposes. We have often seen users
copy-paste console output when reporting issues, and they miss the most
important information: Erlang & SSL library versions. After this change,
we are less likely to have ask about the Erlang & SSL library versions
via follow-up questions.

emu_flavor was introduced in Erlang 24. Erlang 23 has not JIT so we can
always return "emu".

FWIW, we discourage putting new code in rabbitmq_common as this is meant
to be shared between the broker and the client. Also, keeping the
function definitions close to where they are called is a good general
practice.

We discussed the benefits of having the OS line with @dumbbell &
@gerhard and concluded that it's not worth the effort.

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
@gerhard gerhard force-pushed the banner-with-otp-version branch from 9192027 to 52bd0d0 Compare June 24, 2021 11:54
@gerhard
Copy link
Contributor

gerhard commented Jun 24, 2021

You are right @mkuratczyk

While we could have continued with the PR 🏓 and made suggestions, we took the quick route. After tests pass, this is good to merge. Thanks for sticking with this!

image

image

@gerhard gerhard merged commit fa0364d into master Jun 24, 2021
@gerhard gerhard deleted the banner-with-otp-version branch June 24, 2021 15:11
@gerhard
Copy link
Contributor

gerhard commented Jun 24, 2021

Backported to v3.9.x

@gerhard
Copy link
Contributor

gerhard commented Jun 24, 2021

Backported to v3.8.x

gerhard added a commit that referenced this pull request Jun 24, 2021
cc @dumbbell @mkuratczyk

Part of #2777

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
gerhard added a commit that referenced this pull request Jun 24, 2021
cc @dumbbell @mkuratczyk

Part of #2777

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
(cherry picked from commit 2853ec9)
gerhard added a commit that referenced this pull request Jun 24, 2021
My bad backport of #2777
- all good now 🙌

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
@michaelklishin michaelklishin added this to the 3.8.18 milestone Jun 24, 2021
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.

3 participants