> On 八月 25, 2016, 12:32 a.m., Kevin Klues wrote: > > src/slave/containerizer/docker.cpp, line 1555 > > <https://reviews.apache.org/r/50841/diff/6/?file=1480595#file1480595line1555> > > > > I wouldn't just blindly call this function here. It should be wrapped > > in some logic that makes sure it's OK to call it (i.e. checks to make sure > > that we have the nvidia->allocator component passed in). > > > > Again, you could have some logic above which saves a temporary `Future` > > that is set to `Nothing()` by default and is the result of calling > > `deallocateNvidiaGpu()` otherwise.
The `deallocateNvidiaGpu` already have some checking for `nvidiaGpuAllocator`, is this enough? > On 八月 25, 2016, 12:32 a.m., Kevin Klues wrote: > > src/slave/containerizer/docker.cpp, lines 698-710 > > <https://reviews.apache.org/r/50841/diff/6/?file=1480595#file1480595line698> > > > > Why don't you just return from the `deallocate()` call with a > > `.then()`? I.e. > > > > ``` > > return nvidiaGpuAllocator->deallocate(deallocated) > > .then(defer(self(), [=](const Nothing& nothing) { > > containers_[containerId]->gpuAllocated.clear(); > > return Nothing(); > > })); > > ``` > > > > If any failures happen in the deallocation, they should get propagated > > through. With the current logic, we can have more log messages here with different conditions, but seems your proposal is more simple. - Guangya ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/50841/#review146726 ----------------------------------------------------------- On 八月 22, 2016, 10:11 a.m., Yubo Li wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/50841/ > ----------------------------------------------------------- > > (Updated 八月 22, 2016, 10:11 a.m.) > > > Review request for mesos, Benjamin Mahler, Guangya Liu, Kevin Klues, and > Rajat Phull. > > > Bugs: MESOS-5795 > https://issues.apache.org/jira/browse/MESOS-5795 > > > Repository: mesos > > > Description > ------- > > Added control logic to allocate/deallocate GPUs to GPU-related task > when the task is started/terminated. > > > Diffs > ----- > > src/slave/containerizer/docker.hpp f2a06065cf99fed934c2c1ffc47461ec8a97f50d > src/slave/containerizer/docker.cpp 5c1ee8e467d1c54c60b67dc5275ef71e1bb90723 > > Diff: https://reviews.apache.org/r/50841/diff/ > > > Testing > ------- > > make check > > > Thanks, > > Yubo Li > >
