Code0x58 commented on a change in pull request #3663:
URL: https://github.com/apache/incubator-heron/pull/3663#discussion_r556081442
##########
File path: heron/executor/src/python/heron_executor.py
##########
@@ -102,6 +102,7 @@
@click.option("--topology-defn-file", required=True)
@click.option("--topology-id", required=True)
@click.option("--topology-name", required=True)
[email protected]("--enable-verbose-gc-log", required=False)
Review comment:
so you want to add a [boolean option to the click
app](https://click.palletsprojects.com/en/7.x/options/#boolean-flags), which I
think would be best as:
```suggestion
@click.option("--verbose-gc-log", is_flag=True)
```
Without the "enable" as that's implied, and using `is_flag` so that the
parser stores a bool.
##########
File path: heron/executor/src/python/heron_executor.py
##########
@@ -342,6 +343,8 @@ def init_from_parsed_args(self, parsed_args):
self.health_manager_mode = parsed_args.health_manager_mode
self.health_manager_classpath = '%s:%s'\
% (self.scheduler_classpath, parsed_args.health_manager_classpath)
+ self.enable_verbose_gc_log = parsed_args.enable_verbose_gc_log \
+ if parsed_args.enable_verbose_gc_log else False
Review comment:
If you have click see this is a flag with the suggestion above, this
becomes
```suggestion
self.verbose_gc_log = parsed_args.verbose_gc_log
```
##########
File path: heron/executor/src/python/heron_executor.py
##########
@@ -574,36 +577,17 @@ def _get_java_major_version(self):
return int(self._get_jvm_version().split(".")[0])
def _get_java_gc_instance_cmd(self, cmd, gc_name):
- gc_cmd = ['-verbosegc']
- if self._get_java_major_version() >= 9:
- gc_cmd += [
- '-XX:+UseG1GC',
- '-XX:+ParallelRefProcEnabled',
- '-XX:+UseStringDeduplication',
- '-XX:MaxGCPauseMillis=100',
- '-XX:InitiatingHeapOccupancyPercent=30',
- '-XX:+HeapDumpOnOutOfMemoryError',
- '-XX:ParallelGCThreads=4',
- '-Xlog:gc*,safepoint=info:file=' + self.log_dir + '/gc.' + gc_name +
- '.log:tags,time,uptime,level:filecount=5,filesize=100M']
- else:
- gc_cmd += [
- '-XX:+UseConcMarkSweepGC',
- '-XX:+CMSScavengeBeforeRemark',
- '-XX:TargetSurvivorRatio=90',
- '-XX:+PrintGCDetails',
- '-XX:+PrintGCTimeStamps',
- '-XX:+PrintGCDateStamps',
- '-XX:+PrintGCCause',
- '-XX:+UseGCLogFileRotation',
- '-XX:NumberOfGCLogFiles=5',
- '-XX:GCLogFileSize=100M',
- '-XX:+PrintPromotionFailure',
- '-XX:+PrintTenuringDistribution',
- '-XX:+PrintHeapAtGC',
- '-XX:+HeapDumpOnOutOfMemoryError',
- '-XX:ParallelGCThreads=4',
- '-Xloggc:' + self.log_dir + '/gc.' + gc_name + '.log']
+ gc_cmd += [
Review comment:
```suggestion
gc_cmd = [
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]