Client: Rust
Patch: Jano Svitok
This closes#2050
Also contains portions of THRIFT-4547: Upgrade Swift in docker to 5.1.4
Client: Swift
Patch: Jano Svitok
Linux version 4.2.0 does not have FileHandle.acceptConnectionInBackgroundAndNotify()
implemented. We need at least 5.1 for TSocketServer to run in docker.
In the meantime, URLRequest was moved to FoundationNetworking.
To keep compatibility with previous versions, conditional import is
used.
Client: Rust
Patch: Nik Clayton
This closes#2045
Versions 1.1.0 - 1.1.3 of the integer-encoding crate had a bug where
numbers larger than 0x4000_0000_0000_0000 would cause a panic during
decoding.
Add a test to be sure that numbers up to i64::maxvalue() encode and
decode successfully.
Patch: Mario Emmenlauer
This closes#2017
This closes#2018
This closes#2019
- build/cmake/DefineInstallationPaths.cmake: fixed the library path
- build/cmake/ThriftMacros.cmake: do not enforce debug suffix 'd'
- lib/java/CMakeLists.txt: allow to override JAVA_INSTALL_DIR
Client: go
This change improves performance when using TDeserializer with a
resource pool. See https://issues.apache.org/jira/browse/THRIFT-5069 for
more context.
Also add TSerializerPool and TDeserializerPool, which are thread-safe
versions of TSerializer and TDeserializer. Benchmark result shows that
they are both faster and use less memory than the plain version:
$ go test -bench Serializer -benchmem
goos: darwin
goarch: amd64
BenchmarkSerializer/baseline-8 577558 1930 ns/op 512 B/op 6 allocs/op
BenchmarkSerializer/plain-8 452712 2638 ns/op 2976 B/op 16 allocs/op
BenchmarkSerializer/pool-8 591698 2032 ns/op 512 B/op 6 allocs/op
PASS
* changed this to self in forEach callback
* updated minimum node version to 8.16.2 (Maintenance LTS until December 2019)
changed ws_connection.js to work in the browser, with isomorphic-ws
added exports for `wsConnection`, `createWSConnection`, `createWSClient`
* added exports for WSConnection to browser.js
* extended the sample of nodejs code in the browser with webpack
* tested and updated node version to LTS 10.18.0 Dubnium
discussion based: https://github.com/apache/thrift/pull/1927#discussion_r358140463
Custom go.tag in an IDL no longer removes the existing "db" and "json"
tags but can override them.
This allows us to change default tags in the future without affecting
user defined ones.
Client: go
This closes#1963.
* THRIFT-4252: Close sockets when shut down server
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.
* Fix indentation
Use white space for indentation instead of tabulation.
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.