agresch commented on a change in pull request #3295:
URL: https://github.com/apache/storm/pull/3295#discussion_r446236425



##########
File path: storm-client/src/jvm/org/apache/storm/executor/Executor.java
##########
@@ -270,6 +273,15 @@ public ExecutorShutdown execute() throws Exception {
 
     @Override
     public void accept(Object event) {
+        if (this.needToRefreshCreds) {
+            LOG.info("The credentials are being updated {}.", executorId);
+            Credentials creds = this.workerData.getCredentials();
+            idToTask.stream().map(Task::getTaskObject).filter(taskObject -> 
taskObject instanceof ICredentialsListener)
+                    .forEach(taskObject -> {
+                        ((ICredentialsListener) 
taskObject).setCredentials(creds == null ? null : creds.get_creds());
+                    });
+            this.needToRefreshCreds = false;

Review comment:
       I think maybe we should first set  this.needToRefreshCreds to false and 
then update the creds.  Imagine we uploaded credentials twice in a row and this 
loaded the first creds and the thread paused.  It would then clear the update 
flag and miss the second credentials upload.




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to