TTransportException's type was set to "Transport not open" in some cases, which should
be its message.
Use named arguments and set the type for TTransportException to END_OF_FILE in TSocket#read
and TSocket#write.
reviewer: dreiss
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@818429 13f79535-47bb-0310-9956-ffa450edef68
Previously, TSocket.write would raise an AttributeError if the transport
had not been opened. A TTransportException with the code set to
NOT_OPEN is more appropriate. The cost of the check should be
negligible, since TSocket.write is already fairly expensive (it does a
system call).
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@773762 13f79535-47bb-0310-9956-ffa450edef68
Pave the way for a new message type for oneway function calls.
For now, just define the constant in all languages and make
server implementations treat it the same way as a normal call.
Only C++ and Erlang currently check the message type (on the
server side).
There is a little bit of redundancy in the Erlang code, but
the alternative is a bit gross, and this split-up will be
necessary eventually when we start handling one-way calls
differently.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@761389 13f79535-47bb-0310-9956-ffa450edef68
Changing the order of inheritance makes "close" refer to the
(correct) TSocketBase method, rather than the (stub)
TServerTransportBase method.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@758072 13f79535-47bb-0310-9956-ffa450edef68
This was a feature designed to allow a Thrift server to report
information about its interface. However, the feature has
significant design problems, and is presence is currently causing
confusion without doing any good. Therefore, it is being removed.
It will always be in source control if and when we are ready to
come back to it.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@741824 13f79535-47bb-0310-9956-ffa450edef68
TFileObjectTransport is a Thrift transport that wraps a
Python-style file-like object. This is necessary to add
methods like isOpen and readAll.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@739637 13f79535-47bb-0310-9956-ffa450edef68
This involved adding a few methods to provide lower-level access to the
internal read buffer. This will allow us to use TBinaryProtocolAccelerated
with TFramedTransport.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@739632 13f79535-47bb-0310-9956-ffa450edef68
This TNonblockingServer is very similar to the C++ implementation.
It assumes the framed transport, but it uses select instead of libevent.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@712306 13f79535-47bb-0310-9956-ffa450edef68
The position parameter is supposed to be a Py_ssize_t*, not an int*.
This was probably just an oversight in the original patch, and it
was preventing maps from serializing properly on x86-64.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@702640 13f79535-47bb-0310-9956-ffa450edef68
Previously Thrift was using `print` to report errors. Thrift is infrastructure
and should not impose its error logging mechanism on the apps that use it. For
example, [elided] uses the logging module to send logs to a particular file.
I ran the unit test. That exercises most of the error handling routines.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666364 13f79535-47bb-0310-9956-ffa450edef68
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
The python threading model does not provide concurrency for CPU-bound
processes. Process forking is the current recommended way of writing
scalable Python servers.
Harry Wang ran the [elided] backend with this change for 3 days and observed
no errors. The threaded backend caused unexplained lockups under this load
after 24 hours.
I also ran a CPU-bound load test against this server with 32 concurrent
clients. It completed 5X faster than the threaded implementation.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666359 13f79535-47bb-0310-9956-ffa450edef68
Summary:
Redefining an Automake rule totally blows away anything Automake puts in place.
By using all-local instead of all, we can just add to the generated rule.
Reviewed By: marc
Test Plan: make
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665499 13f79535-47bb-0310-9956-ffa450edef68
Summary:
make-generic is some sort of internal undocumented thing.
make-local is what is supposed to be used for this stuff.
Also use $(RM) instead of "rm -f".
Reviewed By: marc
Test Plan: make clean
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665498 13f79535-47bb-0310-9956-ffa450edef68
Summary:
The Python and Java versions of "make check" only work if "make all" has
been run. Our automake-fu isn't strong enough to make proper dependencies,
so this hack suggested by Nitay will force the libraries to be built
before make check is run.
Test Plan: make check
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665497 13f79535-47bb-0310-9956-ffa450edef68
Summary:
- Expanded tabs to spaces where spaces were the norm.
- Deleted almost all trailing whitespace.
- Added newlines to the ends of a few files.
- Ran dos2unix on one file or two.
Reviewed By: mcslee
Test Plan: git diff -b
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665467 13f79535-47bb-0310-9956-ffa450edef68
Summary: Now infinitely more printable than ever before!
Reviewed by: mcslee
Test Plan: except TApplicationException, inst: \n\t\t print inst
Revert: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665414 13f79535-47bb-0310-9956-ffa450edef68
Summary:
Ben Maurer suggested that it would make sense for Thrift to build as
a single project, with one configure.ac and multiple Makefile.am.
He was also kind enough to do the heavy lifting, and this commit
is the application of his patch (with minor modifications).
The most significant visible change from this diff is that
in order to buidl one of the thrift sub-projects (i.e.: the compiler,
the C++ library, or the Python library) you must run bootstrap.sh
and configure in the Thrift root, then make in the specific project.
Users who want to build and install the Python library but
can't run configure because they don't have Boost can simply
run setup.py directly.
Reviewed By: mcslee
Test Plan: Built Thrift from scratch.
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665409 13f79535-47bb-0310-9956-ffa450edef68
Summary: Need to pass hints including AI_ADDRCONFIG to getaddrinfo to make sure no IPv6 addresses come back on non-IPv6 enabled systems
Reviewed By: mcslee
Other Notes: Submitted by Paul Saab
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665368 13f79535-47bb-0310-9956-ffa450edef68
Summary: Throw a proper EOFError in this case. Long term we want to change this to properly fit into the Thrift TException heirarchy with a good way to handle the original exception as well. For now, Ben is the primary user of this so we'll go ahead with his patch.
Reviewed By: mcslee
Test Plan: Included in test/py/TestEof.py
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665365 13f79535-47bb-0310-9956-ffa450edef68