Skip to content

Support RABBITMQ_SERVICE_PRIORITY environment variable in rabbitmq-service.bat install #13919

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

inikulshin
Copy link

@inikulshin inikulshin commented May 20, 2025

Proposed Changes

Support RABBITMQ_SERVICE_PRIORITY environment variable in rabbitmq-service.bat install translating it to
erlsrv.exe's option:

-p[riority] [{low|high|realtime}]
The priority of the Erlang emulator. Default to the Windows default priority.

The reason to avoid manually updating the registry after running the rabbitmq-service.bat install command.

Types of Changes

What types of changes does your code introduce to this project?
Put an x in the boxes that apply

  • 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)
  • Build system and/or CI

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)
  • I have added tests that prove my fix is effective or that my feature works
  • All tests pass locally with my changes
  • If relevant, I have added necessary documentation to https://github.com/rabbitmq/rabbitmq-website
  • If relevant, I have added this change to the first version(s) in release-notes that I expect to introduce it

@inikulshin inikulshin changed the title Support RABBITMQ_SERVICE_PRIORITY Support RABBITMQ_SERVICE_PRIORITY environment variable in rabbitmq-service.bat install May 20, 2025
@lukebakken
Copy link
Collaborator

This is the first time anyone has asked to change the service priority. I'm assuming you must have a valid use case for it, what is it? Changing service priority is not something we generally want to encourage with people who use RabbitMQ on Windows. They may think it's a magic cure for other issues they are having.

@inikulshin
Copy link
Author

This is the first time anyone has asked to change the service priority. I'm assuming you must have a valid use case for it, what is it?

I admit I don't remember why we (Varonis) started to change the RabbitMQ service priority to high (low and realtime are too dangerous, abovenormal is missing in erlsrv, imo). We just do it (updating registry) in our installation script for years.

But recently I wrote a manual for upgrading Erlang at customer's machine (because of CVE):

  1. Open Add or remove programs and find currently installed Erlang (keep opened).
  2. Download latest Erlang Windows installer (same major as in 1, 25 or 26).
  3. Stop Supervisor and RabbitMQ services.
  4. Uninstall Erlang from Add or remove programs
  5. Install downloaded Erlang + copy installation directory from wizard. e.g. to clipboard.
  6. Set system environment variable ERLANG_HOME to installation directory from 5.
  7. Start elevated command prompt and run echo %ERLANG_HOME% && "%RABBITMQ_HOME%\sbin\rabbitmq-service.bat" remove && "%RABBITMQ_HOME%\sbin\rabbitmq-service.bat" install
  8. Set Priority in HKEY_LOCAL_MACHINE\SOFTWARE\Ericsson\Erlang\ErlSrv\1.1\RabbitMQ to High (128).
  9. Start RabbitMQ and Supervisor services.

And I was wondering if there is a way to get rid of this registry modification step, and found that erlsrv.exe already supports -priority, and I thought: "why not make this minor contribution to rabbitmq-server?" :)

Changing service priority is not something we generally want to encourage with people who use RabbitMQ on Windows. They may think it's a magic cure for other issues they are having.

Since when do you care about the people who use RabbitMQ on Windows? Just joking. :)))

It's still possible (by editing registry) and I don't think the way I implemented it is "encouraging".

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.

2 participants