Skip to content

Commit 6027d21

Browse files
committed
Increase timeout for OOM profile export (#206)
Also ensure that stdout/stderr from the child process are redirected to stderr from the parent process.
1 parent ec40304 commit 6027d21

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

bindings/profilers/heap.cc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ static int CreateTempFile(uv_loop_t& loop, std::string& filepath) {
323323
}
324324

325325
static void ExportProfile(HeapProfilerState& state) {
326-
const int64_t timeoutMs = 5000;
326+
const int64_t timeoutMs = 15000;
327327
uv_loop_t loop;
328328
int r;
329329

@@ -355,6 +355,14 @@ static void ExportProfile(HeapProfilerState& state) {
355355
options.file = args[0];
356356
options.args = args.data();
357357
options.exit_cb = &OnExit;
358+
uv_stdio_container_t child_stdio[3];
359+
child_stdio[0].flags = UV_IGNORE;
360+
child_stdio[1].flags = UV_INHERIT_FD;
361+
child_stdio[1].data.fd = 2;
362+
child_stdio[2].flags = UV_INHERIT_FD;
363+
child_stdio[2].data.fd = 2;
364+
options.stdio = child_stdio;
365+
options.stdio_count = 3;
358366
uv_process_t child_req;
359367
uv_timer_t timer;
360368
timer.data = &child_req;

0 commit comments

Comments
 (0)