@@ -844,8 +844,11 @@ def _get_instance_plans(self, packing_plan, container_id):
844
844
if container_plan .id == container_id :
845
845
this_container_plan = container_plan
846
846
847
- # make sure that our shard id is a valid one
848
- assert this_container_plan is not None
847
+ # When the executor runs in newly added container by `heron update`,
848
+ # there is no plan for this container. In this situation,
849
+ # return None to bypass instance processes.
850
+ if this_container_plan is None :
851
+ return None
849
852
return this_container_plan .instance_plans
850
853
851
854
# Returns the common heron support processes that all containers get, like the heron shell
@@ -973,9 +976,22 @@ def start_process_monitor(self):
973
976
log_pid_for_process (name , p .pid )
974
977
975
978
def get_commands_to_run (self ):
979
+ """
980
+ Prepare either TMaster or Streaming commands according to shard.
981
+ The Shell command is attached to all containers. The empty container plan and non-exist
982
+ container plan are bypassed.
983
+ """
976
984
# During shutdown the watch might get triggered with the empty packing plan
977
985
if len (self .packing_plan .container_plans ) == 0 :
978
986
return {}
987
+ if self ._get_instance_plans (self .packing_plan , self .shard ) is None and self .shard != 0 :
988
+ retval = {}
989
+ retval ['heron-shell' ] = [
990
+ '%s' % self .heron_shell_binary ,
991
+ '--port=%s' % self .shell_port ,
992
+ '--log_file_prefix=%s/heron-shell-%s.log' % (self .log_dir , self .shard ),
993
+ '--secret=%s' % self .topology_id ]
994
+ return retval
979
995
980
996
if self .shard == 0 :
981
997
commands = self ._get_tmaster_processes ()
0 commit comments