Currently, the generated exception classes are not hashable under
Python 3 because of the generated `__eq__` method. Exception objects
are generally expected to be hashable by the Python standard library.
Post-construction mutation of an exception object seems like a very
unlikely case, so enable hashing for all exceptions by making them
immutable by default. This also adds a way to opt-out of immutability
by setting the `python.immutable` annotation to `"false"`.
Thrift attempts to work-around the Python 2.7 DeprecationWarning
around `BaseException.message` by using a property. This hack is
unnecessary since `message` is _also_ written as a regular attribute in
the `TException` constructor (and would be in any of its children),
hence the `BaseException_get_message()` wouldn't even be called.
This hack also stands in the way of making exception instances
immutable (which is a prerequisute to fixing THRIFT-4002).
Client: Rust
Patch: Julian Tescher
This closes#1956
It is useful for `TBufferChannel` to be `Clone` so that you can use it to read bytes that were written by a client for use cases like testing or sending over alternative transports like UDP.
Client: ruby
Patch: Grégoire Seux
This closes#1924
Before this patch, any error on the http layer was ignored and usually
seen by the user as ProtocolException instead of TransportException
If a thrift file includes two files from the same namespace into a
separate file, the generated Go code has duplicate imports for that
namespace. This fixes that.
Client: go
This is the fourth and final part of THRIFT-4914, which handles the
client reading part in the response (server -> client direction).
Client: go
This closes#1926.
Fix a bug where remote.go client fails to compile when services
extend other services and the parent service has a function that
needs a container for its arguments.
Client:go
This closes#1925.
This is the third part of THRIFT-4914, which handles the server writing
part in the response (server -> client direction).
Define a new type, TResponseHelper, which only contains THeader related
functions for now, but can be extended for other functions in the
future.
In TSimpleServer, inject a TResponseHelper into the context object
passed into the handler functions. Handler function code could retrieve
the injected TResponseHelper to set headers to be written to the client.
Client: go
This closes#1923.
TCompactProtocol (which is used by THeaderTransport to read headers)
could wrap the underlying error with TProtocolException, which breaks
err == io.EOF test in some cases.
Client: go
This closes#1922.
This is a different approach to take THRIFT-4984: Instead of checking
EOF errors in place, handle them in a consolidated, deferred function.
Also improve test error messages.
Client: go
This closes#1907.
Client: Python
Patch: Kevin Wojniak
This closes#1912
Fixes MSVC warning seen in logs:
> [00:11:03] src\ext/protocol.tcc(177): warning C4101: 'ex': unreferenced
> local variable [C:\projects\build\MSVC2015\x86\lib\py\python_build.vcxproj]
- Add a new Logger type to make logging configurable
- Use the new logger in TSimpleServer and TDebugProtocol
- Remove pointless log in TZlibTransport
- Remove panic recovery from TSimpleServer. Thrift shouldn't catch panics caused by caller-defined RPC handlers.
Client: go
This closes#1906.
In TThreadPoolServer, threads are blocking in io with open sockets,
as long as clients don't close the connection, server threads are
never stopped even after a shutdown is called on server (because
they are blocked waiting for io).
To be able to stop all server threads properly, server should
proactively close sockets once a shutdown is initiated.
Update most dependencies to their latest versions, replace findbugs with
spotbugs as the former is dead and was replaced with the latter.
Fixes THRIFT-4937.
Client: java
Client: Build system
Patch: Jens Geyer
This closes#1894
The patch contains a modified version of tar.m4. The --hard-dereference option prevents from a situation, where symlinks (used in the compiler/src subtree) get converted into hard links.
When the socket is closed (EOF of the inputstream), currently
TIOStreamTransport throws an TTransportException without message,
this is sometimes confusing for people maintaining a thrift server
(eg. apache hive).
Client: java
This closes#1876.
Client: go
This is the second part of THRIFT-4914, which handles the client writing
part in the requests (client -> server direction).
In TStandardClient, when the context has write headers set, and the
protocol is THeaderProtocol, automatically extract all headers from the
context object and set to THeaderProtocol to send over the wire.
Client code can set headers into the context object by using the helper
functions in header_context.go.
Note that we have separated keys for read and write header key list, so
that for code that's both a server and a client (example: a server that
calls other upstream thrift servers), they don't automatically forward
all headers to their upstream servers, and need to explicitly set which
headers to forward.
In order to make auto forwarding easier, also add SetForwardHeaders
function to TSimpleServer, which will help the users to auto forward
selected headers.
This closes#1845.
Client: go
This is the first part of THRIFT-4914, which handles the server reading
part in the requests (client -> server direction).
In TSimpleServer, when the protocol is THeaderProtocol automatically
add all present headers into the context object before passing
it to processor, so the processor code can access headers from the
context directly by using the new helper functions added in
header_context.go.
This closes#1840.
Client: go
Previously the library didn't check against double wrapping, so when
NewTSimpleServerN was used with both THeaderTransportFactory and
THeaderProtocolFactory, inside THeaderProtocolFactory the transport
was double wrapped with THeaderTransport.
Worse, the transport still appeared to work, because THeaderTransport
is backwards compatible with TBinaryProtocol and TCompactProtocol
so the outer layer of THeaderTransport wrapper (the one directly accessible
from the protocol) would assume the client doesn't support THeader and
fallback. So when double wrapping happened, it appeared like everything
was fine, except you couldn't get the headers from the protocol (because
they were in the inner THeaderTransport, not the outer one that's directly
accessible from the protocol), making it very hard to debug.
This commit adds protection against such double wrapping.
This closes#1839.
Two fixes here:
1. Additional logic to properly catch and handle TTransportException.
Currently, T(SASL)TransportException gets caught and handled in
the wrong catch-block.
2. The fix for THRIFT-3769 mutes _all_ TTransportExceptions in TThreadPoolServer.
This might mute legitimate failures. The intent of THRIFT-3769 (and
THRIFT-2268) was to mute the noise caused by TTransportException.END_OF_FILE.
This commit lets legitimate failures to be bubbled upwards.
Due to the way SSL layers on top of sockets, it was possible
to complete a connection and then have the server close it.
This would happen if the client is not checking certificates
but the server is. The TSSLSocket unit test was enhanced to
do a read and a write as well as just connecting to ensure a
more complete test.
The TSocket read() and write() calls were leaking OSError,
socker.error, and ssl.Error exceptions. These cases are now
wrapped into a TTransportException of the appropriate type,
and the original exception is added as an argument named inner.
- Include rebar3 in docker image so erlang builds in CI
- Include the correct path in docker image so rust builds in CI
- Updated common lisp (sbcl) to 1.5.3 in docker image
- Updated dlang to 2.087.0 in docker image
- Updated dart to 2.0.0 in xenial docker image
- Updated dart to 2.4.0 in bionic docker image
- Updated erlang to 22.0 in docker image
- Updated openjdk to 11.0.3 in docker image
- Updated node.js to 10.16 in docker image
- Updated rust to 1.34.0 in xenial docker image
- Updated rust to 1.35.0 in bionic docker image
THRIFT-4905: Disable hanging experimental dlang async ssl test
Client: go
Implement THeaderTransport and THeaderProtocol, with support of:
* clients:
- headers
- framedBinary
- unframedBinary
- framedCompact
- unframedCompact
* transforms:
- none
- zlib
* info types:
- key_value
* wrapped protocols:
- TBinary
- TCompact
The support list is in general on par of the THeader implementation in
the python library.
The cross-test passes, except ones related to cpp/nodejs http transport,
which were also failing for non-theader protocols.
This change also fixes two bugs:
1. A small issue in test/go/src/bin/testserver/main.go
2. A bug in TFrameTransport go implementation
Client: php
CURLOPT_TIMEOUT requires a long [0], so it seems that small values
like 0.2 are being rounded to 0, resulting in a lack of any timeout.
This change uses CURLOPT_TIMEOUT_MS, which the PHP documentation
says was "added in cURL 7.16.2. Available since PHP 5.2.3."
[0] https://curl.haxx.se/libcurl/c/CURLOPT_TIMEOUT.html
TryFrom is now stable, so use that. Additionally re-export OrderedFloat since
it is used by the generated code. Relax dependencies to reduce downstream
conflicts.
* THRIFT-4024: make c_glib throw on unsupported type when skipping
* THRIFT-4783: throw on invalid skip (py)
* THRIFT-4024: make cpp throw on unsupported type when skipping
* THRIFT-4024: uniform skip behavior on unsupported type
Client: php (extension)
When reference is passed to php extension, it's unreferenced (instead of
derefrenced). The next time one tries to use the same variable PHP
segaults. Even if not used again, php segfaults on
user_shutdown_function_call.
* THRIFT-4024: make c_glib throw on unsupported type when skipping
* THRIFT-4783: throw on invalid skip (py)
* THRIFT-4024: make cpp throw on unsupported type when skipping
* THRIFT-4024: uniform skip behavior on unsupported type
The java TestClient asks the server to runa oneway request that
sleeps for 3 seconds. If the java TestClient sees the duration
of the call exceed one second, it fails the test. This means the
server did not participate in the "fire and forget" dynamics of
ONEWAY requests. In this case the THttpServer was processing the
RPC before sending the transport response. The fix was to enhance
the TProcessor so that the THttpServer has an opportunity to inspect
the message header before processing the RPC.
This is partly due to the violation of the THttpServer in the
layered architecture. It is essentially implementing a combined
server and transport, whereas there should be a distinct server,
protocol, and transport separation. Many languages seem to have
this problem where HTTP was introduced.
* use override
* use make_shared
* use emplace
* use range for
* fix error on MSVC
* replace boost functions with std functions
* fix static analyzer warnings
* check api return value
* initialize member
* check the return value of SSL_peek > 0
* add override
* [THRIFT-4766] Enable JDK9 build
* THRIFT-4766: build on bionic using native jdk (java-11-openjdk)
Change from headless to the normal JDK. Maybe the libasound is pulled
in transitively.
* make use of C++11 override keyword
* added const specifier to TTransport::getOrigin()
* added more const correctness to the compiler
* make use of auto keyword
* replaced usage of NULL with nullptr
* make use of explicitly-defaulted function definition
* extended changelog
* THRIFT-4654 Minor fixes for dart 1 & 2 compatibility
* update dockerfiles for CI to test dart 2
* THRIFT-4654 update pubspec for tests
* THRIFT-4654 update dart test generator and readme to 1.24.3
* THRIFT-4654 update generated dart sdk to a range
* fix the dart tutorials
* Add .dart_tool directories to .gitignore
* THRIFT-4654: use dart 2.1.0 and fix cross test dart client timeout
THRIFT-4737: [added beforeSend to add customHeaders to jqXHR in jqRequest]
Client: [lib/js]
locally tested - custom headers where missing when using jq. So I added these lines to fix it.