thrift/test/py
David Reiss bcaa2ad0d6 Python forking server should close connection in parent.
When a function called by the forking python thrift server throws an
exception the client will hang.  This happens because the parent of the
forked process does not properly close the socket fd.

Under normal operation the server operation completes and returns a value to
the client.  However, when an exception occurs the 'end' message is never
sent to the client so the client relies on a connection close to abort the
call (this is how the threading server works I believe).

This fails with the forking server because the parent process never closes
the socket fd.  The child has closed the fd at this point, but the
connection will not actually be closed until all open instances of the fd
are closed. Since the client is waiting for a message and the server never
closes it the client is forced to wait until a read timeout occurs many
minutes later.

This diff closes the parent's copy of the socket fd immediately after the
fork occurs.

I modified my load test server to throw an exception.  The client did not hang.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666363 13f79535-47bb-0310-9956-ffa450edef68
2008-06-10 22:55:26 +00:00
..
explicit_module Make the Python generator use non-hardcoded namespaces. 2008-03-27 21:41:54 +00:00
Makefile.am Make "make clean" rules a bit more standard. 2008-02-24 16:42:18 +00:00
RunClientServer.py Python forking server should close connection in parent. 2008-06-10 22:55:26 +00:00
SerializationTest.py Thrift: Python test improvements. 2008-02-15 01:10:23 +00:00
TestClient.py Python forking server should close connection in parent. 2008-06-10 22:55:26 +00:00
TestEof.py Thrift: Python test improvements. 2008-02-15 01:10:23 +00:00
TestServer.py Python forking server should close connection in parent. 2008-06-10 22:55:26 +00:00
TestSocket.py Thrift: Whitespace cleanup. 2008-02-06 22:18:40 +00:00