Open
Description
Hi,
I'm still trying to replace some Gunicorn with Unit, but I have issues when I try to shut down Unit gracefully. I expect it to properly handle the current requests before shutting down.
So, I have Unit running into a container, I made a request with curl, and during the process I stop the container with: sudo docker stop -t 60 -s 9 django_unit
.
The process continues, but the socket is closed. So the curl gets an error with an empty reply:
romain@grace-hopper:~ curl http://localhost:8000/test/timeout
curl: (52) Empty reply from serve
In the container output, I see that the process continues, but the server can't respond to the client at the end:
0
1
2
2023/05/11 14:29:09 [notice] 1#1 process 44 exited with code 0
2023/05/11 14:29:09 [notice] 1#1 process 45 exited with code 0
3
4
2023/05/11 14:29:23 [warn] 47#47 [unit] sendmsg(11, 311) failed: Broken pipe (32)
2023/05/11 14:29:23 [notice] 46#46 app process 47 exited with code 0
2023/05/11 14:29:23 [alert] 46#46 sendmsg(13, -1, -1, 2) failed (32: Broken pipe)
2023/05/11 14:29:23 [notice] 1#1 process 46 exited with code 0
Did I miss some configuration?
I put all the necessary stuff to reproduce this here https://github.com/RomainMou/unit-django-issue-headers#timeout.