MCPcopy Create free account
hub / github.com/apache/mesos / getContainerTermination

Function getContainerTermination

src/slave/containerizer/mesos/paths.cpp:303–328  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

301
302
303Result<ContainerTermination> getContainerTermination(
304 const string& runtimeDir,
305 const ContainerID& containerId)
306{
307 const string path = path::join(
308 getRuntimePath(runtimeDir, containerId),
309 TERMINATION_FILE);
310
311 if (!os::exists(path)) {
312 // This is possible because we don't atomically create the
313 // directory and write the 'TERMINATION' file and thus we might
314 // terminate/restart after we've created the directory but
315 // before we've written the file.
316 return None();
317 }
318
319 Result<ContainerTermination> termination =
320 state::read<ContainerTermination>(path);
321
322 if (termination.isError()) {
323 return Error("Failed to read termination state of container: " +
324 termination.error());
325 }
326
327 return termination;
328}
329
330
331string getStandaloneContainerMarkerPath(

Callers 1

waitMethod · 0.85

Calls 7

getRuntimePathFunction · 0.85
NoneClass · 0.85
errorMethod · 0.65
joinFunction · 0.50
existsFunction · 0.50
ErrorFunction · 0.50
isErrorMethod · 0.45

Tested by

no test coverage detected