YARN-9331. [YARN-8851] Fix a bug that lacking cgroup initialization when bootstrap DeviceResourceHandlerImpl. Contributed by Zhankun Tang.
This commit is contained in:
parent
a6ab37192a
commit
c6ea28c480
|
@ -122,8 +122,9 @@ public class DeviceResourceHandlerImpl implements ResourceHandler {
|
|||
}
|
||||
// Add device set. Here we trust the plugin's return value
|
||||
deviceMappingManager.addDeviceSet(resourceName, availableDevices);
|
||||
// TODO: Init cgroups
|
||||
|
||||
// Init cgroups
|
||||
this.cGroupsHandler.initializeCGroupController(
|
||||
CGroupsHandler.CGroupController.DEVICES);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -164,6 +164,8 @@ public class TestDevicePluginAdapter {
|
|||
mockShellWrapper);
|
||||
adapter.setDeviceResourceHandler(drhl);
|
||||
adapter.getDeviceResourceHandler().bootstrap(conf);
|
||||
verify(mockCGroupsHandler).initializeCGroupController(
|
||||
CGroupsHandler.CGroupController.DEVICES);
|
||||
int size = dmm.getAvailableDevices(resourceName);
|
||||
Assert.assertEquals(3, size);
|
||||
// Case 1. A container c1 requests 1 device
|
||||
|
|
Loading…
Reference in New Issue