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

[Bug] runbroker.cmd miss %JAVA_OPT% on windows #9154

Open
3 tasks done
frankcrc opened this issue Jan 23, 2025 · 0 comments
Open
3 tasks done

[Bug] runbroker.cmd miss %JAVA_OPT% on windows #9154

frankcrc opened this issue Jan 23, 2025 · 0 comments

Comments

@frankcrc
Copy link

Before Creating the Bug Report

  • I found a bug, not just asking a question, which should be created in GitHub Discussions.

  • I have searched the GitHub Issues and GitHub Discussions of this repository and believe that this is not a duplicate.

  • I have confirmed that this bug belongs to the current repository, not other repositories of RocketMQ.

Runtime platform environment

Windows 11

RocketMQ version

rocketmq 5.2.0 release

JDK Version

Oracle JDK 1.8_u202

Describe the Bug

Run a namesrv, and check cmd line in Task Manager or Process Explorer, then you will see JAVA_OPT, like -Xmx, is missing.

This is JAVA_OPT config in runserver.cmd.
runserver.cmd_JAVA_OPT

This is CMD line of the namesrv process.
cmd line

Steps to Reproduce

  1. Prepare a namesrv config file, let say namesrv.conf. I think it does not matter, but just to reproduce my env.
enableControllerInNamesrv = true
controllerDLegerGroup = group1
controllerDLegerPeers = n0-127.0.0.1:9877
controllerDLegerSelfId = n0
  1. Prepare a powershell script file, let say start-namesrv-w-c.ps1.
$env:JAVA_OPT='-Duser.home=D:\data\mq_data\rocketmq-all-5.2.0-bin-release\data\namesrv'
$env:ROCKETMQ_HOME='D:\data\mq_data\rocketmq-all-5.2.0-bin-release'
D:\data\mq_data\rocketmq-all-5.2.0-bin-release\bin\mqnamesrv.cmd -c D:\data\mq_data\rocketmq-all-5.2.0-bin-release\data\namesrv.conf
  1. Open a Powershell and execute the script file, .\start-namesrv-w-c.ps1.
  2. Check process cmd line.

What Did You Expect to See?

the java process cmd line should contain -Xmx300m and all other jvm options.

What Did You See Instead?

only JAVA_OPT what I set in start-namesrv-w-c.ps1 is kept.

Additional Context

I think it should be the problem of batch variable substitution. When I comment out the IF statement, JAVA_OPT comes back.

runserver.cmd diff

This is CMD line of the namesrv process.
Image

If possible, I would be happy to create a PR.

Related Issue, #8579,
Related PR, #7507

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

No branches or pull requests

1 participant