Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Added config toggle for verbose GC logging #3663

Merged
merged 17 commits into from
Jan 21, 2021

Conversation

nicknezis
Copy link
Contributor

@nicknezis nicknezis commented Jan 12, 2021

I added a config item to toggle the verbose GC logging. Not sure if this is the best way to do it. There was another option to add it to the heron_internals.yml. In the end I thought this might be the better approach because it would allow for the analytic to set the value.

I also removed some of the pre-JDK9 config options because Heron is now on JDK 11.

@nicknezis nicknezis requested review from nwangtw and Code0x58 January 12, 2021 19:26
@nicknezis nicknezis self-assigned this Jan 12, 2021
heron/executor/src/python/heron_executor.py Outdated Show resolved Hide resolved
heron/executor/src/python/heron_executor.py Outdated Show resolved Hide resolved
heron/executor/src/python/heron_executor.py Outdated Show resolved Hide resolved
@nicknezis
Copy link
Contributor Author

This fixes #3659

nicknezis and others added 4 commits January 12, 2021 18:10
Co-authored-by: Oliver Bristow <evilumbrella+github@gmail.com>
Co-authored-by: Oliver Bristow <evilumbrella+github@gmail.com>
Co-authored-by: Oliver Bristow <evilumbrella+github@gmail.com>
Co-authored-by: Oliver Bristow <evilumbrella+github@gmail.com>
@nicknezis nicknezis marked this pull request as ready for review January 12, 2021 23:11
@nicknezis nicknezis requested a review from Code0x58 January 12, 2021 23:11
Copy link
Contributor

@Code0x58 Code0x58 left a comment

Choose a reason for hiding this comment

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

At least the python side appears ok. I can't approve on the Java side without further reading, but I'd double check the naming and how it connects to the executor (particularly as this may be the first is_flag example so my earlier suggestion may case issues, and this may be the first Boolean option)

@Code0x58 Code0x58 self-requested a review January 13, 2021 03:11
@nicknezis
Copy link
Contributor Author

I'm going to do some actual testing before merging, so hopefully will catch any name mismatches.

Copy link
Contributor

@nwangtw nwangtw left a comment

Choose a reason for hiding this comment

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

Overall LGTM other than the question about "-Xloggc".

"-Djava.net.preferIPv4Stack=true " \
"-XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:+UseStringDeduplication " \
"-XX:MaxGCPauseMillis=100 -XX:InitiatingHeapOccupancyPercent=30 " \
"-XX:+HeapDumpOnOutOfMemoryError -XX:ParallelGCThreads=4 " \
Copy link
Contributor

Choose a reason for hiding this comment

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

"Xloggc:log-files/gc.%s.log" and the instance_name are still necessary I feel since all the logs are in the same folder.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

-Xloggc set of flags are all related to the GC logging. In my testing, I still saw JVM component log files in the log-files folder. This change should only remove the GC specific logging (unless someone chooses to enable at submit time).

I believe if the verbose-gc flag is not set, the changes I made to the code will not set those JVM flags. This unit test is testing with the defaults, so what you see here matches what was generated by the heron_executor.py.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah. The flag is for gc logs only, but it separates different gc logs into different files. For example, the gc log for this process would be "log-files/gc.healthmgr.log" and each process has its own gc log file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the heron_executor functionality that was setting that path and log file names is still there. It's just not there for the default submission. You have to use the flag to enable those parameters.

These lines of code that you are commenting on are test results for the default case that does not have verbose_gc enabled. If there was a test for the verbose_gc use case, then we would have another version of this string that included the various GC log parameters. I'm not sure how much more work it will be to add another test case that captures that scenario, but I will look into making it.

"-XX:GCLogFileSize=100M -XX:+PrintPromotionFailure -XX:+PrintTenuringDistribution " \
"-XX:+PrintHeapAtGC -XX:+HeapDumpOnOutOfMemoryError -XX:ParallelGCThreads=4 " \
"-Xloggc:log-files/gc.healthmgr.log " \
"-Djava.net.preferIPv4Stack=true " \
Copy link
Contributor

Choose a reason for hiding this comment

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

"-Xloggc:log-files" might be necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as comment above. I believe -Xloggc:log-files is a GC specific setting. This does not impact the default logging.

"-Djava.net.preferIPv4Stack=true " \
"-XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:+UseStringDeduplication " \
"-XX:MaxGCPauseMillis=100 -XX:InitiatingHeapOccupancyPercent=30 " \
"-XX:+HeapDumpOnOutOfMemoryError -XX:ParallelGCThreads=4 " \
Copy link
Contributor

Choose a reason for hiding this comment

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

"-Xloggc:log-files" might be necessary.

"-Djava.net.preferIPv4Stack=true " \
"-XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:+UseStringDeduplication " \
"-XX:MaxGCPauseMillis=100 -XX:InitiatingHeapOccupancyPercent=30 " \
"-XX:+HeapDumpOnOutOfMemoryError -XX:ParallelGCThreads=4 " \
Copy link
Contributor

Choose a reason for hiding this comment

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

"-Xloggc:log-files" might be necessary.

@nicknezis
Copy link
Contributor Author

@nwangtw Is it ok that I modified the Heron CLI to add the new argument? In the future I want to also add a flag to toggle the heap dump JVM feature. Would I also add that as a flag on the CLI? It's there a more generic way to provide overrides per analytic submission when submitting to a remote Heron server?

@nwangtw
Copy link
Contributor

nwangtw commented Jan 14, 2021

@nwangtw Is it ok that I modified the Heron CLI to add the new argument? In the future I want to also add a flag to toggle the heap dump JVM feature. Would I also add that as a flag on the CLI? It's there a more generic way to provide overrides per analytic submission when submitting to a remote Heron server?

Yeah. I think passing from CLI could be very useful. I remember we can pass extra topology configs from CLI now but I can't remember the details. @huijunw @xiaoyao1991 ?

@joshfischer1108
Copy link
Member

@nwangtw Is it ok that I modified the Heron CLI to add the new argument? In the future I want to also add a flag to toggle the heap dump JVM feature. Would I also add that as a flag on the CLI? It's there a more generic way to provide overrides per analytic submission when submitting to a remote Heron server?

Yeah. I think passing from CLI could be very useful. I remember we can pass extra topology configs from CLI now but I can't remember the details. @huijunw @xiaoyao1991 ?

I think it's here:

Something like --config-property PROPERTY=VALUE

@nicknezis
Copy link
Contributor Author

@Code0x58 Github is still showing that you have "1 change requested". I'm not sure if that is something I can resolve or if you need to re-review to clear that state.

@nicknezis
Copy link
Contributor Author

Also a general re-review is probably warranted. I was able to test running an analytic with and without the flag and it seemed to operate as I wanted.

@nicknezis nicknezis merged commit f11ebc3 into apache:master Jan 21, 2021
@nicknezis nicknezis deleted the nicknezis/verbose-gc-toggle branch January 21, 2021 05:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants