mynameborat commented on a change in pull request #1139: SAMZA-2301: Add 
non-null checks in JobModel read control-flow in standalone.
URL: https://github.com/apache/samza/pull/1139#discussion_r315906331
 
 

 ##########
 File path: samza-core/src/main/java/org/apache/samza/zk/ZkJobCoordinator.java
 ##########
 @@ -538,14 +546,15 @@ public ZkJobModelVersionChangeHandler(ZkUtils zkUtils) {
     @Override
     public void doHandleDataChange(String dataPath, Object data) {
       debounceTimer.scheduleAfterDebounceTime(JOB_MODEL_VERSION_CHANGE, 0, () 
-> {
-          String jobModelVersion = (String) data;
+          jobModelVersion = (String) data;
+
 
           LOG.info("Got a notification for new JobModel version. Path = {} 
Version = {}", dataPath, data);
 
           newJobModel = readJobModelFromMetadataStore(jobModelVersion);
           LOG.info("pid=" + processorId + ": new JobModel is available. 
Version =" + jobModelVersion + "; JobModel = " + newJobModel);
 
-          if (!newJobModel.getContainers().containsKey(processorId)) {
+          if (newJobModel != null && 
!newJobModel.getContainers().containsKey(processorId)) {
 
 Review comment:
   Until this change, the else code path corresponds to the case where the 
processor is ensured to be part of the new job model generated. However, with 
this change, we blur the distinction between processor being part of the job 
model vs job model unavailable. 
   I suppose the by product of that is you can potentially have a stream 
processor running that is not part of the quorum or doesn't have any work to 
do. 
   If that is intended, please add a comment and link the existing ticket.

----------------------------------------------------------------
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]


With regards,
Apache Git Services

Reply via email to