MCPcopy Create free account
hub / github.com/apache/impala / RunStackDump

Method RunStackDump

be/src/kudu/util/pstack_watcher.cc:246–272  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

244#endif
245
246Status PstackWatcher::RunStackDump(const vector<string>& argv) {
247 printf("************************ BEGIN STACKS **************************\n");
248 if (fflush(stdout) == EOF) {
249 return Status::IOError("Unable to flush stdout", ErrnoToString(errno), errno);
250 }
251 Subprocess pstack_proc(argv);
252 RETURN_NOT_OK_PREPEND(pstack_proc.Start(), "RunStackDump proc.Start() failed");
253 int ret;
254 RETRY_ON_EINTR(ret, ::close(pstack_proc.ReleaseChildStdinFd()));
255 if (ret == -1) {
256 return Status::IOError("Unable to close child stdin", ErrnoToString(errno), errno);
257 }
258 RETURN_NOT_OK_PREPEND(pstack_proc.Wait(), "RunStackDump proc.Wait() failed");
259 int exit_code;
260 string exit_info;
261 RETURN_NOT_OK_PREPEND(pstack_proc.GetExitStatus(&exit_code, &exit_info),
262 "RunStackDump proc.GetExitStatus() failed");
263 if (exit_code != 0) {
264 return Status::RuntimeError("RunStackDump proc.Wait() error", exit_info);
265 }
266 printf("************************* END STACKS ***************************\n");
267 if (fflush(stdout) == EOF) {
268 return Status::IOError("Unable to flush stdout", ErrnoToString(errno), errno);
269 }
270
271 return Status::OK();
272}
273
274} // namespace kudu

Callers

nothing calls this directly

Calls 8

ErrnoToStringFunction · 0.85
RuntimeErrorFunction · 0.85
OKFunction · 0.85
ReleaseChildStdinFdMethod · 0.80
GetExitStatusMethod · 0.80
IOErrorFunction · 0.70
StartMethod · 0.45
WaitMethod · 0.45

Tested by

no test coverage detected