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

IGNITE-23196 [ducktests] Change JVM options to JDK11 ones #11536

Merged

Conversation

okreda1
Copy link
Contributor

@okreda1 okreda1 commented Sep 16, 2024

  • changed default settings for gc log (-Xloggc ->-Xlog:gc)
  • added new logs for safepoints
  • added new variable to disable safepoints log
  • removed UnlockCommercialFeatures because it was used only for jfr, but no longer needed for openjdk11
  • changed option in check_boolean_options__go_after_default_ones_and_overwrite_them__if_passed_via_jvm_opt to FlightRecorder
  • changed option in check_colon_options__go_after_default_ones_and_overwrite_them__if_passed_via_jvm_opt to -Xlog:gc

Thank you for submitting the pull request to the Apache Ignite.

In order to streamline the review of the contribution
we ask you to ensure the following steps have been taken:

The Contribution Checklist

  • There is a single JIRA ticket related to the pull request.
  • The web-link to the pull request is attached to the JIRA ticket.
  • The JIRA ticket has the Patch Available state.
  • The pull request body describes changes that have been made.
    The description explains WHAT and WHY was made instead of HOW.
  • The pull request title is treated as the final commit message.
    The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
  • A reviewer has been mentioned through the JIRA comments
    (see the Maintainers list)
  • The pull request has been checked by the Teamcity Bot and
    the green visa attached to the JIRA ticket (see TC.Bot: Check PR)

Notes

If you need any help, please email [email protected] or ask anу advice on http://asf.slack.com #ignite channel.

- changed default settings for gc log (-Xloggc ->-Xlog:gc)
- added new logs for safepoints
- added new variable to disable safepoints log
- removed UnlockCommercialFeatures because it was used only for jfr, but no longer needed for openjdk11
- removed check_boolean_options__go_after_default_ones_and_overwrite_them__if_passed_via_jvm_opt, because there is no longer an option in settings
- changed option in check_colon_options__go_after_default_ones_and_overwrite_them__if_passed_via_jvm_opt to -Xlog:gc
@@ -79,19 +78,10 @@ def check_default_jvm_options__are_not_used__if_merge_with_default_is_false(serv
assert len(spec.jvm_opts) == 0


def check_boolean_options__go_after_default_ones_and_overwrite_them__if_passed_via_jvm_opt(service):
Copy link
Contributor

@skorotkov skorotkov Sep 17, 2024

Choose a reason for hiding this comment

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

Even if the UnlockCommercialFeatures option is not used for JVM 11+ anymore it's not a reason to drop the test for the boolean options support. Just choose another boolean option. The -XX:+FlightRecorder would be ok I think.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Returned the test, tweaked it to check FlightRecorder in options

@@ -102,6 +102,10 @@ def __get_default_jvm_opts(self):
oom_path=os.path.join(self.service.log_dir, "out_of_mem.hprof"),
vm_error_path=os.path.join(self.service.log_dir, "hs_err_pid%p.log"))

if not self.service.context.globals.get(SAFEPOINT_LOGS_DISABLED, False):
default_jvm_opts = merge_jvm_settings(
default_jvm_opts, ["-Xlog:safepoint:" + os.path.join(self.service.log_dir, "safepoint.log")])
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use more readable settings for log file like:

-Xlog:safepoint*=debug:file=/mnt/service/logs/safepoint.log:time,uptime,level,tags

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

"""
Provides settings string for JVM process.
param opts: JVM options to merge. Adds new or rewrites default values. Can be list or string.
"""
gc_dump = ""
if gc_dump_path:
gc_dump = "-verbose:gc -Xloggc:" + gc_dump_path
gc_dump = "-Xlog:gc:" + gc_dump_path
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use more readable settings for log file like

-Xlog:gc*=debug,gc+stats*=debug,gc+ergo*=debug:/mnt/service/logs/gc.log:uptime,time,level,tags

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -31,14 +31,14 @@


def create_jvm_settings(heap_size=DEFAULT_HEAP, gc_settings=JVM_PARAMS_GC_G1, generic_params=JVM_PARAMS_GENERIC,
gc_dump_path=None, oom_path=None, vm_error_path=None):
gc_dump_path=None, oom_path=None, vm_error_path=None,):
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

By mistake, removed it

@@ -27,6 +27,7 @@
# globals:
JFR_ENABLED = "jfr_enabled"
IGNITE_TEST_CONTEXT_CLASS_KEY_NAME = "IgniteTestContext"
SAFEPOINT_LOGS_DISABLED = "SafePointLogsDisabled"
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use the snake case for global variable name (in other words follow the existing approach of already existing variables: jfr_enabled, ignite_versions, jmx_remote etc.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -27,6 +27,7 @@
# globals:
JFR_ENABLED = "jfr_enabled"
IGNITE_TEST_CONTEXT_CLASS_KEY_NAME = "IgniteTestContext"
SAFEPOINT_LOGS_DISABLED = "SafePointLogsDisabled"
Copy link
Contributor

Choose a reason for hiding this comment

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

Please also change it *_enabled (with True by default). In all other variables we have enabled but not disabled.

Say "safepoint_log_enabled".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor

Choose a reason for hiding this comment

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

just for record

After all it was decided to have it False by default to not increase total logs size in results for tests which do not need it

@okreda1 okreda1 force-pushed the IGNITE-23196_Change_JVM_options_to_JDK11_ones branch from d1e8ac9 to 9df0689 Compare September 20, 2024 07:24
- Added special run options to the Readme
- Fixed few small issues in Readme
@okreda1 okreda1 force-pushed the IGNITE-23196_Change_JVM_options_to_JDK11_ones branch from 9df0689 to 8984375 Compare September 20, 2024 11:18
- Fixed check_colon_options__go_after_default_ones_and_overwrite_them__if_passed_via_jvm_opt check
- Changed readme.
- safepoint log now disbled by default.
}
}
```
Options `key_store_jks` and `trust_store_jks` is paths.
Copy link
Contributor

Choose a reason for hiding this comment

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

... are paths

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

}
```
Options `key_store_jks` and `trust_store_jks` is paths.
If you start it with `/` it will be used as an absolute path, otherwise as a relative path.
Copy link
Contributor

Choose a reason for hiding this comment

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

Relative to which directory ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Specified

assert spec.jvm_opts.index("-XX:-UnlockCommercialFeatures") >\
spec.jvm_opts.index("-XX:+UnlockCommercialFeatures")
spec = IgniteApplicationSpec(service, jvm_opts="-XX:-FlightRecorder")
assert "-XX:-FlightRecorder" in spec.jvm_opts
Copy link
Contributor

Choose a reason for hiding this comment

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

We have here 2 identical asserts.

I think one of them should be replaced with the
assert "-XX:+FlightRecorder" in spec.jvm_opts

Otherwise it doesn't make sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

- Changed readme.
- Changed test check_boolean_options__go_after_default_ones_and_overwrite_them__if_passed_via_jvm_opt
@okreda1 okreda1 force-pushed the IGNITE-23196_Change_JVM_options_to_JDK11_ones branch from 88d3c45 to d647c0a Compare September 23, 2024 12:02
Copy link

sonarcloud bot commented Sep 23, 2024

@ivandasch ivandasch merged commit a86e0c8 into apache:master Sep 23, 2024
8 checks passed
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