Github user johnsca commented on a diff in the pull request:

    https://github.com/apache/bigtop/pull/162#discussion_r88919639
  
    --- Diff: 
bigtop-packages/src/charm/hadoop/layer-hadoop-resourcemanager/reactive/resourcemanager.py
 ---
    @@ -131,16 +131,28 @@ def send_nn_spec(namenode):
     @when_not('apache-bigtop-resourcemanager.started')
     def start_resourcemanager(namenode):
         hookenv.status_set('maintenance', 'starting resourcemanager')
    -    # NB: service should be started by install, but this may be handy in 
case
    -    # we have something that removes the .started state in the future. Also
    -    # note we restart here in case we modify conf between install and now.
    -    host.service_restart('hadoop-yarn-resourcemanager')
    -    host.service_restart('hadoop-mapreduce-historyserver')
    -    for port in get_layer_opts().exposed_ports('resourcemanager'):
    -        hookenv.open_port(port)
    -    set_state('apache-bigtop-resourcemanager.started')
    -    hookenv.application_version_set(get_hadoop_version())
    -    hookenv.status_set('maintenance', 'resourcemanager started')
    +    # NB: service should be started by install, but we want to verify it is
    +    # running before we set the .started state and open ports. We always
    +    # restart here, which may seem heavy-handed. However, restart works
    +    # whether the service is currently started or stopped. It also ensures 
the
    +    # service is using the most current config.
    +    rm_started = host.service_restart('hadoop-yarn-resourcemanager')
    +    if rm_started:
    +        for port in get_layer_opts().exposed_ports('resourcemanager'):
    +            hookenv.open_port(port)
    +        set_state('apache-bigtop-resourcemanager.started')
    +        hookenv.status_set('maintenance', 'resourcemanager started')
    +        hookenv.application_version_set(get_hadoop_version())
    +    else:
    +        hookenv.log('YARN ResourceManager failed to start')
    +        hookenv.status_set('blocked', 'resourcemanager failed to start')
    +        remove_state('apache-bigtop-resourcemanager.started')
    --- End diff --
    
    No, this will prevent related services from trying to use the RM before it 
is started.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to