Properly shut down fastcgi worker threads when connection is closed
commit60d27550e305d92463469de2b16fc125bae8d79a
authorbsimmers <bsimmers@fb.com>
Mon, 4 Aug 2014 19:09:19 +0000 (4 12:09 -0700)
committerfacebook-github-bot <githubbot@fb.com>
Thu, 7 Aug 2014 07:30:22 +0000 (7 00:30 -0700)
tree49ab0e2e03fab48b743e845336259e4d7ae624f3
parentd5254ef43fbdbc8f55cfc8263f78519bdd59069a
Properly shut down fastcgi worker threads when connection is closed

Summary: If the fastcgi connection from the webserver was closed while a
request was reading its POST data, the worker thread processing that request
would get stuck indefinitely waiting for the rest of the data to arrive. Given
enough time, all worker threads in the server could get stuck, causing the
server to become completely unresponsive until a restart. Make sure we notify
the appropriate condition variable to avoid this.

Reviewed By: @ptarjan

Differential Revision: D1476306
hphp/runtime/server/fastcgi/fastcgi-server.cpp
hphp/runtime/server/fastcgi/fastcgi-session.cpp
hphp/runtime/server/fastcgi/fastcgi-session.h