Hi,
I'm using prodigy 1.10.5 and I've run into the following issue:
When a client ends connection abruptly (during an on-going HTTP request) prodigy crashes due to SIGPIPE.
In HTTP servers this is an undesired behavior, SIGPIPE should be handled gracefully. Below is output of strace before the crash happens.
10:19:03 clock_gettime(CLOCK_MONOTONIC, {tv_sec=861, tv_nsec=327235367}) = 0
10:19:03 read(15<socket:[46892]>, 0x555729f8c3bc, 256000) = -1 ECONNRESET (Connection reset by peer)
10:19:03 write(15<socket:[46892]>, "zammSDgmXZ4l1JEX1JFJ85CuO3x3Iqsp"..., 278768) = -1 EPIPE (Broken pipe)
10:19:03 --- SIGPIPE {si_signo=SIGPIPE, si_code=SI_USER, si_pid=295, si_uid=0} ---
10:19:03 +++ killed by SIGPIPE +++
I am able to reproduce this on a fresh AWS instance within docker container, t2.micro, Amazon Linux 2 (amzn2-ami-hvm-2.0.20201126.0-x86_64-gp2)
Dockerfile:
FROM python:3.7
RUN mkdir /images
RUN curl https://upload.wikimedia.org/wikipedia/commons/thumb/1/1e/Caerte_van_Oostlant_4MB.jpg/1591px-Caerte_van_Oostlant_4MB.jpg --output /images/file.jpg
WORKDIR /prodigy
COPY prodigy-1.10.5-cp36.cp37.cp38-cp36m.cp37m.cp38-linux_x86_64.whl /prodigy
RUN pip install prodigy-1.10.5-cp36.cp37.cp38-cp36m.cp37m.cp38-linux_x86_64.whl
ENV PRODIGY_HOST=0.0.0.0
ENV PRODIGY_PORT=5000
CMD prodigy image.manual sigpipe_crash_repro /images --label cat,not_cat
Then:
$ docker build . -t sigpipe_repro
$ docker run -p 5000:5000 -it sigpipe_repro
Finally, visit prodigy in the browser and hit refresh before the request completes.