mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [mesos] bmahler commented on a change in pull request #353: hook manager mutex and global variable enhancement
Date Mon, 23 Mar 2020 18:07:23 GMT
bmahler commented on a change in pull request #353: hook manager mutex and global variable
enhancement
URL: https://github.com/apache/mesos/pull/353#discussion_r396651964
 
 

 ##########
 File path: src/hook/manager.cpp
 ##########
 @@ -240,18 +242,20 @@ Future<DockerTaskExecutorPrepareInfo>
   // `DockerTaskExecutorPrepareInfo` can be deterministically resolved
   // (the last hook takes priority).
   vector<Future<Option<DockerTaskExecutorPrepareInfo>>> futures;
-  futures.reserve(availableHooks.size());
-
-  foreachvalue (Hook* hook, availableHooks) {
-    // Chain together each hook.
-    futures.push_back(
-        hook->slavePreLaunchDockerTaskExecutorDecorator(
-            taskInfo,
-            executorInfo,
-            containerName,
-            containerWorkDirectory,
-            mappedSandboxDirectory,
-            env));
+  synchronized (mutex) {
+    futures.reserve((*availableHooks).size());
 
 Review comment:
   How about `availableHooks->size()` here and all other `(*availableHooks).method()` cases
in this patch? That would be more idiomatic with our code base

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


With regards,
Apache Git Services

Mime
View raw message