Skip to content

Fixing RABBITMQ_CONFIG_ARG_FILE variable #1881

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 2 commits into from
Feb 13, 2019

Conversation

Gsantomaggio
Copy link
Member

The rabbit_prelaunch module can read the os:getenv(RABBITMQ_CONFIG_ARG_FILE) correctly

Proposed Changes

With this PR the rabbit_prelaunch can read the variable RABBITMQ_CONFIG_ARG_FILE correctly.

Found the bug (RMQ 3.7.11) while I was trying to set:

[
 {kernel, [
    {inet_dist_listen_min, 50000},
    {inet_dist_listen_max, 50000}
    ]}
].

on the etc/rabbitmq/advanced.config file, and did not work.

The RABBITMQ_CONFIG_ARG_FILE was not read and the rabbitmq-server script always set the default values (PRELAUNCH_RESULT was always 0).

3.6.x had to do the same

Types of Changes

What types of changes does your code introduce to this project?

  • Bug fix (non-breaking change which fixes issue #NNNN)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause an observable behavior change in existing systems)
  • Documentation improvements (corrections, new content, etc)
  • Cosmetic change (whitespace, formatting, etc)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating
the PR. If you're unsure about any of them, don't hesitate to ask on the
mailing list. We're here to help! This is simply a reminder of what we are
going to look for before merging your code.

  • I have read the CONTRIBUTING.md document
  • I have signed the CA (see https://cla.pivotal.io/sign/rabbitmq)
  • All tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in related repositories

The rabbit_prelaunch module can read the os:getenv(RABBITMQ_CONFIG_ARG_FILE) correctly
Copy link
Collaborator

@lukebakken lukebakken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Gsantomaggio thanks for noticing this. I think RABBITMQ_CONFIG_ARG_FILE needs to be removed as it isn't documented and only used by the prelaunch step ... and not very effectively at that. What makes this more complicated is the introduction of the rabbitmq.conf file whose contents can really only be verified after processing.

@lukebakken
Copy link
Collaborator

lukebakken commented Feb 13, 2019

@Gsantomaggio advanced.config is only read if rabbitmq.conf is also present. You can use /etc/rabbitmq/rabbitmq.conf to set those values (schema):

inet_dist_listen_min = 50000
inet_dist_listen_max = 50000

Or, you can create the /etc/rabbitmq/rabbitmq.config file with your original, Erlang-term configuration.

@Gsantomaggio
Copy link
Member Author

Gsantomaggio commented Feb 13, 2019

@lukebakken thanks
but I forgot to mention that:

$ cat etc/rabbitmq/rabbitmq.conf
vm_memory_high_watermark.relative = 0.3
inet_dist_listen_min = 50000
inet_dist_listen_max = 50000

does not work :)
see:

➜  rabbitmq_server-3.7.11 sbin/rabbitmqctl report | grep inet_dist_listen_min
      {inet_dist_listen_min,25672},

this because of the RABBITMQ_DIST_PORT is assigned during the rabbit_prelaunch

In 3.6.x it worked because of the value was read directly from the conf file

in 3.7.x is suppose to read RABBITMQ_CONFIG_ARG_FILE

@lukebakken lukebakken changed the title Assing RABBITMQ_CONFIG_ARG_FILE variable Fixing RABBITMQ_CONFIG_ARG_FILE variable Feb 13, 2019
@lukebakken
Copy link
Collaborator

@Gsantomaggio - I can reproduce this, but the fix will have to take rabbitmq.conf into account somehow. Let me see what we can come up with.

@Gsantomaggio
Copy link
Member Author

@lukebakken I think the same, I was focusing on the advanced.config because I get this message:

Unable to update config for app kernel from a .conf file. The app is already running. 
Use advanced.config instead.

@lukebakken
Copy link
Collaborator

OK, since we generate config from rabbitmq.conf after the VM starts, we can't set these kernel values at that time. I'll take that into account too.

@lukebakken
Copy link
Collaborator

lukebakken commented Feb 13, 2019

@Gsantomaggio I think your change will suffice, but I'm doing some testing and will remove the settings from the rabbit.schema file. I'm also testing net_ticktime since I don't trust that it will work.

lukebakken added a commit to rabbitmq/rabbitmq-website that referenced this pull request Feb 13, 2019
@lukebakken
Copy link
Collaborator

You can change net_ticktime after the VM starts, but not the dist ports. We would have to run cuttlefish as part of the startup scripts to support that.

Also see rabbitmq/rabbitmq-website#687

Thanks @Gsantomaggio

@michaelklishin michaelklishin changed the base branch from v3.7.x to master February 13, 2019 20:52
@michaelklishin michaelklishin changed the base branch from master to v3.7.x February 13, 2019 20:52
@michaelklishin
Copy link
Collaborator

@Gsantomaggio please submit all future PRs against master.

@michaelklishin michaelklishin merged commit 70f00bb into v3.7.x Feb 13, 2019
@michaelklishin michaelklishin deleted the rabbitmq-server_prelaunch branch February 13, 2019 21:04
@michaelklishin michaelklishin added this to the 3.7.12 milestone Feb 13, 2019
@Gsantomaggio
Copy link
Member Author

@michaelklishin I will.
I was looking for the stable branch, but I think you changed the repositories organization :)!

@lukebakken
I am going to remove this configuration from the rabbitmq.conf.example file

Gsantomaggio pushed a commit that referenced this pull request Feb 14, 2019
michaelklishin pushed a commit that referenced this pull request Feb 14, 2019
part of #1881

(cherry picked from commit c32870a)
kjnilsson pushed a commit that referenced this pull request Feb 20, 2019
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