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

Fix shutdown with jmx javaagent enabled #899

Merged
merged 3 commits into from
Oct 30, 2024
Merged

Conversation

bianchi2
Copy link
Collaborator

@bianchi2 bianchi2 commented Oct 25, 2024

Addresses https://jira.atlassian.com/browse/SCALE-141 and #897

This PR adds jmx exporter JVM flags to CATALINA_OPTS instead of JVM_SUPPORT_RECOMMENDED_ARGS (all products except Bitbucket)

When jmx is enabled in Helm chart values, a javaagent is added to JVM_SUPPORT_RECOMMENDED_ARGS that is included JAVA_OPTS.

From catalina.sh:

   #   JAVA_OPTS       (Optional) Java runtime options used when any command
   #                   is executed.
   #                   Include here and not in CATALINA_OPTS all options, that
   #                   should be used by Tomcat and also by the stop process,
   #                   the version command etc.
   #                   Most options should go into CATALINA_OPTS.

As a result, when Tomcat is stopped, javaagent starts and since it already listens on jmx exporter port, it fails. This results in non-graceful shutdown.

From catalina.sh:

#   CATALINA_OPTS   (Optional) Java runtime options used when the "start",
#                   "run" or "debug" command is executed.
#                   Include here and not in JAVA_OPTS all options, that should
#                   only be used by Tomcat itself, not by the stop process,
#                   the version command etc.

Checklist

  • I have added unit tests
  • I have applied the change to all applicable products
  • The E2E test has passed (use e2e label)

@bianchi2 bianchi2 added e2e and removed e2e labels Oct 25, 2024
@bianchi2 bianchi2 added e2e and removed e2e labels Oct 25, 2024
@bianchi2 bianchi2 merged commit 1ef5e0b into main Oct 30, 2024
14 checks passed
@bianchi2 bianchi2 deleted the SCALE-141-fix-shutdown branch October 30, 2024 00:12
@farthinder
Copy link

Thanks for this!

@saldor100
Copy link

When will this be released ? its only been merged to the main

@bianchi2
Copy link
Collaborator Author

We plan the next release early next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants