Open shaunwarman opened 7 years ago
Something seems up with pipe from child process. Seems to buffer completely.
FROM node:7
# strace -p 1
Process 1 attached
clock_gettime(CLOCK_MONOTONIC, {27232, 111901229}) = 0
epoll_wait(5, {{EPOLLIN, {u32=12, u64=12}}}, 1024, -1) = 1
clock_gettime(CLOCK_MONOTONIC, {27249, 722996103}) = 0
read(12, "PING google.com (172.217.8.174):"..., 65536) = 4096
clock_gettime(CLOCK_MONOTONIC, {27249, 723143828}) = 0
clock_gettime(CLOCK_MONOTONIC, {27249, 723362668}) = 0
clock_gettime(CLOCK_MONOTONIC, {27249, 723393631}) = 0
clock_gettime(CLOCK_MONOTONIC, {27249, 723419700}) = 0
clock_gettime(CLOCK_MONOTONIC, {27249, 723532566}) = 0
clock_gettime(CLOCK_MONOTONIC, {27249, 723562630}) = 0
clock_gettime(CLOCK_MONOTONIC, {27249, 723588399}) = 0
clock_gettime(CLOCK_MONOTONIC, {27249, 723620961}) = 0
clock_gettime(CLOCK_MONOTONIC, {27249, 723744014}) = 0
clock_gettime(CLOCK_MONOTONIC, {27249, 723853284}) = 0
clock_gettime(CLOCK_MONOTONIC, {27249, 723882849}) = 0
clock_gettime(CLOCK_MONOTONIC, {27249, 723908818}) = 0
clock_gettime(CLOCK_MONOTONIC, {27249, 723974840}) = 0
clock_gettime(CLOCK_MONOTONIC, {27249, 724003206}) = 0
clock_gettime(CLOCK_MONOTONIC, {27249, 724033670}) = 0
clock_gettime(CLOCK_MONOTONIC, {27249, 724065133}) = 0
clock_gettime(CLOCK_MONOTONIC, {27249, 724107782}) = 0
clock_gettime(CLOCK_MONOTONIC, {27249, 724290664}) = 0
clock_gettime(CLOCK_MONOTONIC, {27249, 724320429}) = 0
clock_gettime(CLOCK_MONOTONIC, {27249, 724345699}) = 0
mmap(0x1fdb29b00000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x1fdb29b00000
mprotect(0x1fdb29b03000, 4096, PROT_NONE) = 0
mmap(0x1fdb29b04000, 503808, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x1fdb29b04000
mprotect(0x1fdb29b7f000, 4096, PROT_NONE) = 0
FROM mhart/alpine-node:base-8
# strace -p 1
strace: Process 1 attached
clock_gettime(CLOCK_MONOTONIC, {tv_sec=27722, tv_nsec=229971466}) = 0
epoll_wait(5, [{EPOLLIN, {u32=12, u64=12}}], 1024, -1) = 1
clock_gettime(CLOCK_MONOTONIC, {tv_sec=27722, tv_nsec=576268221}) = 0
read(12, "64 bytes from 172.217.1.46: seq="..., 65536) = 57
write(11, "{\"data\":\"{\\\"event\\\":\\\"log\\\",\\\"da"..., 52) = 52
Including my comments, FWIW: it appears that somehow the pipe between ping
and node
is not ready to be read until it is full. I have no idea why!
Description https://github.com/shaunwarman/docker-child-proc
I have a simple nodejs script that spawns a child process and runs
ping google.com
. If I run this locally outside of container it runs fine with expected stdout logging every second or so. Within the container it seems the child pid logs standard output maybe once a minute or so.Steps to reproduce the issue: https://github.com/shaunwarman/docker-child-proc
Describe the results you received: Common ping output every second.
Describe the results you expected: stdout from child process is happening about once every minute.
Output of docker version: