Commit Graph

55 Commits

Author SHA1 Message Date
Jens Geyer
fb87b440cd Updated changes.md for 0.16.0 2022-01-21 09:39:09 +01:00
Jens Geyer
e3be32112a Merge branch '0.15.0' into upstream 2021-09-11 23:00:25 +02:00
Jens Geyer
8317ec43ea Branch 0.15.0 2021-09-04 20:45:55 +02:00
Yuxuan 'fishy' Wang
67bf304de1 THRIFT-5459: Fix breaking issue when adding a new exception
Client: go

Currently in the compiler generated go code, adding a new exception to
an existing endpoint can cause unexpected behaviors when the client
isn't updated. Fix the issue.

Will be cherry-picked into 0.15.0 after merged.
2021-09-03 22:25:33 -07:00
Yuxuan 'fishy' Wang
cdbcff9995 THRIFT-5459: Fix breaking issue when adding a new exception
Client: go

Currently in the compiler generated go code, adding a new exception to
an existing endpoint can cause unexpected behaviors when the client
isn't updated. Fix the issue.

Will be cherry-picked into 0.15.0 after merged.
2021-09-03 22:24:25 -07:00
Yuxuan 'fishy' Wang
5f829f143c go: Fix things staticcheck complains about
Client: go

Staticcheck is the recommended replacement of the frozen and deprecated
official golint linter [1].

Fix the things it complained about (or add lint:ignore directive) in:

- lib/go/thrift
- lib/go/test/tests
- tutorial/go/src
- test/go/src
- compiler generated code

The majority of the fixes are in the following categories:

- Use of deprecated function (mainly the TConfiguration related ones)
- Redundant break in switch cases
- Unused and unexported variables/fields/functions

Also in the same spirit as fb539ae, remove the error return from
NewTSSLSocket as it can never be non-nil.

This change will be cherry-picked into 0.15.0 branch after merged.

[1]: https://groups.google.com/g/golang-nuts/c/rCP70Aq_tBc
2021-08-27 09:28:37 -07:00
Yuxuan 'fishy' Wang
17373a3f35 go: Fix things staticcheck complains about
Client: go

Staticcheck is the recommended replacement of the frozen and deprecated
official golint linter [1].

Fix the things it complained about (or add lint:ignore directive) in:

- lib/go/thrift
- lib/go/test/tests
- tutorial/go/src
- test/go/src
- compiler generated code

The majority of the fixes are in the following categories:

- Use of deprecated function (mainly the TConfiguration related ones)
- Redundant break in switch cases
- Unused and unexported variables/fields/functions

Also in the same spirit as fb539ae, remove the error return from
NewTSSLSocket as it can never be non-nil.

This change will be cherry-picked into 0.15.0 branch after merged.

[1]: https://groups.google.com/g/golang-nuts/c/rCP70Aq_tBc
2021-08-27 09:28:08 -07:00
Yuxuan 'fishy' Wang
efff4a2691 THRIFT-5453: Defer DNS from NewTSocketConf to TSocket.Open
Client: go

We used to do DNS lookups in NewTSocketConf, without any timeout checks.
Stop doing that and do DNS lookups in TSocket.Open instead, which
already checks for ConnectTimeout set in TConfiguration.

Also remove the error return from NewTSocketConf.
2021-08-11 11:11:54 -07:00
Yuxuan 'fishy' Wang
fb539ae412 THRIFT-5453: Defer DNS from NewTSocketConf to TSocket.Open
Client: go

We used to do DNS lookups in NewTSocketConf, without any timeout checks.
Stop doing that and do DNS lookups in TSocket.Open instead, which
already checks for ConnectTimeout set in TConfiguration.

Also remove the error return from NewTSocketConf.
2021-08-11 11:08:49 -07:00
Jens Geyer
9a815fa0a2 Version 0.15.0 2021-08-03 22:58:12 +02:00
Yuxuan 'fishy' Wang
2c78047fcb THRIFT-4797: Go import improvements
This change improves two problems in go code imports:

1. Always rename import the thrift package into "thrift", as we allow
   the user to use a different library to replace the official one from
   the compiler command line, this makes sure that in compiler generated
   go code we can always blindly use "thrift.*".

2. We added auto rename import dedup in d9019fc5a4, but in that change
   for system packages we always use the full import path as the dedup
   identifier, so system package "database/sql/driver" would not be
   detected as a conflict against a thrift go namespace of
   "foo.bar.driver". Use the part after the last "/" in system packages
   as the dedup identifier instead.
2021-08-01 10:07:45 -07:00
Jens Geyer
c19d05eeef Version 0.14.2 2021-06-15 23:48:17 +02:00
Yuxuan 'fishy' Wang
fe3f8a1279 THRIFT-5404: Allow other types of TTransportException to be timeouts
Client: go

Currently we only treat TTransportException with typeId == TIMED_OUT as
timeout (return true in Timeout function). When opening a new socket, if
we got a connect timeout from net.Dial, we wrap the error as
TTransportException with typeId == NOT_OPEN, thus it's no longer treated
as a timeout error.

Change the error to be directly wrapping the original error (instead of
recreate a new error with the same error message), and change
tTransportException.Timeout to also return true if the wrapped error
is a timeout error. This way we don't have to break anything (if code
rely on TTransportException.TypeId being NOT_OPEN in this case, that's
still true).

While I'm here, also update CHANGES.md from #2359.
2021-04-28 18:49:58 -07:00
Jens Geyer
430e540ef9 added breaking change notice for THRIFT-5396 2021-04-10 10:19:43 +02:00
Yuxuan 'fishy' Wang
6583f4e523 THRIFT-5369: Use MaxMessageSize to check container sizes
Client: go
2021-04-09 11:22:33 -07:00
Jens Geyer
5bae216dbc merged 0.14.1 changes into master & added 0.15.0 breaking changes section
Patch: Jens Geyer
2021-03-27 01:03:26 +01:00
Jens Geyer
0be1b7d758 Version 0.14.0 2021-02-04 23:36:10 +01:00
Jens Geyer
de523c79b3 Updated CHANGES to reflect Version 0.14.0 2021-02-04 17:41:23 +01:00
Yuxuan 'fishy' Wang
c2ddaf0766 THRIFT-4914: Make TClient.Call to return the response meta
Client: go

Make a breaking change so that TClient.Call returns the response
meta, currently only contains headers but could be expanded in the
future, and make a compiler change to compiler generated clients to take
advantage of that and provide access to response metadata to users.
2021-01-22 20:50:27 -08:00
Yuxuan 'fishy' Wang
d831230929 THRIFT-5326: Expand TException interface in go library
Client: go

Add TExceptionType enum type, and add

    TExceptionType() TExceptionType

function to TException definition.

Also make TProtocolException unwrap-able.
2021-01-17 15:19:44 -08:00
Yuxuan 'fishy' Wang
c4d1c0d800 THRIFT-5322: Implement TConfiguration in Go library
Client: go

Define TConfiguration following the spec, and also move the following
configurations scattered around different TTransport/TProtocol into it:

- connect and socket timeouts for TSocket and TSSLSocket
- tls config for TSSLSocket
- max frame size for TFramedTransport
- strict read and strict write for TBinaryProtocol
- proto id for THeaderTransport

Also add TConfiguration support for the following and their factories:

- THeaderTransport and THeaderProtocol
- TBinaryProtocol
- TCompactProtocol
- TFramedTransport
- TSocket
- TSSLSocket

Also define TConfigurationSetter interface for easier TConfiguration
propagation between wrapped TTransports/TProtocols , and add
implementations to the following for propagation
(they don't use anything from TConfiguration themselves):

- StreamTransport
- TBufferedTransport
- TDebugProtocol
- TJSONProtocol
- TSimpleJSONProtocol
- TZlibTransport

TConfigurationSetter are not implemented by the factories of the
"propagation only" TTransports/TProtocols, if they have a factory. For
those use cases, TTransportFactoryConf and TProtocolFactoryConf are
provided to wrap a factory with the ability to propagate TConfiguration.

Also add simple sanity check for TBinaryProtocol and TCompactProtocol's
ReadString and ReadBinary functions. Currently it only report error if
the header length is larger than MaxMessageSize configured in
TConfiguration, for simplicity.
2021-01-17 12:24:13 -08:00
Mario Emmenlauer
47d4a00f51 Deprecated WinXP and Server2003 methods
Client: cpp
Patch: Mario Emmenlauer

This closes #2165
2020-09-12 18:52:22 +02:00
Yuxuan 'fishy' Wang
4db7a0af13 THRIFT-5240: Do connectivity check in Go server
Client: go

In compiler generated TProcessorFunction implementations, add a
goroutine after read the request to do connectivity check on the input
transport. If the transport is no longer open, cancel the context object
passed into the handler implementation.

Also define ErrAbandonRequest error, to help TSimpleServer closing
client connections that's already closed on the other end.
2020-07-01 11:50:44 -07:00
Yuxuan 'fishy' Wang
5dc1d268f5 THRIFT-5152: Separate timeout in TSSLSocket
Client: go

We separated timeout in go's TSocket into connect timeout and socket
timeout in 81334cd, this change does the same for TSSLSocket to keep
them consistent.

Also rename the arg in NewTSocketFromConnTimeout from connTimeout to
socketTimeout, because in that function we already have a connection,
so connect timeout is never used again. The timeout passed into that
function is really for socket timeout, not connect timeout. The name of
that function actually means "New TSocket From Conn (with) Timeout", not
"New TSocket From ConnTimeout" (I guess that's where the original
confusion came from).

Also add the missing change note for the breaking change.
2020-06-30 10:07:48 -07:00
Yuxuan 'fishy' Wang
e79f764f09 THRIFT-5233: Handle I/O timeouts in go library
Client: go

As discussed in the JIRA ticket, this commit changes how we handle I/O
timeouts in the go library.

This is a breaking change that adds context to all Read*, Write*, and
Skip functions to TProtocol, along with the compiler change to support
that, and also adds context to TStandardClient.Recv, TDeserializer,
TStruct, and a few others.

Along with the function signature changes, this commit also implements
context cancellation check in the following TProtocol's ReadMessageBegin
implementations:

- TBinaryProtocol
- TCompactProtocol
- THeaderProtocol

In those ReadMessageBegin implementations, if the passed in context
object has a deadline attached, it will keep retrying the I/O timeout
errors, until the deadline on the context object passed. They won't
retry I/O timeout errors if the passed in context does not have a
deadline attached (still return on the first error).
2020-06-15 13:28:38 -07:00
max ulidtko
dabfea2f98 THRIFT-5186: Rewrite address resolution in T{Nonblocking,}ServerSocket
Client: cpp
Patch: Max Ulidtko

This closes #2151
2020-06-09 23:09:25 +02:00
Jens Geyer
7de1f5d7f3 Added breaking change notice for "THRIFT-5138 Swift keywords may be used as identifiers if escaped" because it is labelled as such in JIRA 2020-05-20 00:55:10 +02:00
Mario Emmenlauer
55680af8fa
Update NodeJS to oldest supported version on Ubuntu Xenial 2020-05-11 21:58:48 +01:00
Yuxuan 'fishy' Wang
0c173bf9e0
THRIFT-5164: Small cleanup on example code
Client: go

Godoc requires at least one other exported type/function to render the
whole example file in the example, so export
simpleProcessorLoggingMiddleware to make the example of
ProcessorMiddleware more helpful.

Currently it's rendered in a not very helpful way:
https://pkg.go.dev/github.com/apache/thrift@v0.13.1-0.20200430141240-5cffef964a08/lib/go/thrift?tab=doc#example-ProcessorMiddleware

Compare to the client middleware example rendering:
https://pkg.go.dev/github.com/apache/thrift@v0.13.1-0.20200430141240-5cffef964a08/lib/go/thrift?tab=doc#example-ClientMiddleware

While I'm here, also update CHANGES.md to mention ClientMiddleware.

[skip ci]
2020-05-01 07:49:29 +01:00
Andrew Boyle
00c039adeb
THRIFT-5164: Add middleware framework for Go servers
This commit adds a simple middleware framework for Go servers.

It provides:

 * A `ProcessorMiddleware` function interface used to define the actual middleware
 * `WrapProcessor`, the function that you use to wrap a `TProcessor` in a list of middleware
 * A helper `WrappedTProcessorFunction` struct to help with developing middleware

This is a breaking change for any custom implementations of the `TProcessor`
interface, but does not effect the code generated by compiling Thrift files. It
adds two functions to the interface that are a part of the generated `TProcessor`
code, but were not defined in the interface explicitly.
2020-04-27 19:32:24 +01:00
zeshuai007
adf278dae0 fix typos in CHANGES.md
Patch: zeshuai007

This closes #2053
2020-03-10 22:46:59 +01:00
Jens Geyer
56700e469d THRIFT-4982 Remove deprecated C# bindings from the code base
Client: csharp
Patch: Jens Geyer

This closes #2027
2020-02-28 19:18:34 +01:00
Homarechan
ded326101a THRIFT-5072 Fix data type generation.
Client: hs
Patch: Homarechan <tikuwakunn@icloud.com>

This closes #1974
2020-02-06 23:21:02 +01:00
Yuxuan 'fishy' Wang
397645ac24 THRIFT-5069: Make TDeserializer resource pool friendly
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
2020-01-18 20:55:51 +00:00
Jens Geyer
ffb97e105c THRIFT-4990 Upgrade to .NET Core 3.1 (LTS)
Client: netstd
Patch: Jens Geyer

This closes #1961
2019-12-07 08:47:32 +01:00
Andy Seaborne
622937162a THRIFT-5022: Fix TIOStreamTransport.isOpen for input or output only use
Client: java

This closes #1942.
2019-11-25 09:58:52 +00:00
Jens Geyer
2646bd65b5 THRIFT-5006 Implement DEFAULT_MAX_LENGTH at TFramedTransport
Client: Delphi
Patch: Jens Geyer
2019-11-13 09:34:58 +01:00
Jens Geyer
ec439548c5 THRIFT-4990 Switch to .NET core 3.0
Client: netstsd
Patch: Jens Geyer

This closes #1909
2019-11-02 17:34:23 +01:00
Jens Geyer
a3fa0d928f Version 0.13.0 2019-10-17 00:07:13 +02:00
wineandcheeze
ab89b8b40e THRIFT-2530: Fix TIOStreamTransport#isOpen
isOpen should return false when close is called.

Client: java

This closes #1878.
2019-10-10 12:50:50 +01:00
James E. King III
178891f7d6 THRIFT-4805: Fixed readme files 2019-07-08 09:56:59 -04:00
Mithun RK
c35ed736d2 THRIFT-4805: Suppress excessive logging of SASL TTransportExceptions in case of END_OF_FILE
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.
2019-07-08 09:56:59 -04:00
Danny Browning
181d900a39 THRIFT 4536: Rust 1.34.0
Update dockerfiles to use rust stable, call out required rust version in
breaking changes.
2019-04-15 09:55:04 -06:00
Jens Geyer
0223091b70 THRIFT-4841 THTTPTransport relies on activeX component
Client: Delphi
Patch: Jens Geyer

This closes #1778
2019-04-06 09:53:09 +02:00
James E. King III
e6fa4aac49 Merge changelog from 0.9.3.1 release to master [ci skip] 2019-03-13 08:50:49 -04:00
James E. King III
f95620d2b1 THRIFT-4405: sanity tests relating to sequence numbers
- prove all servers return the sequence ID given
- prove that sequences that wrap around the int32_t space are handled ok
2019-02-01 11:13:49 -05:00
Sebastian Zenker
042580f534 THRIFT-4762: Applied some C++11 refactorings to the runtime library and compiler (#1719)
* 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
2019-01-29 09:48:12 -05:00
Jens Geyer
aa0c8b35d8 THRIFT-4723 Consolidate C#/netcore into new netstd language target
Client: netstd
Patch: Jens Geyer

This closes #1710
2019-01-28 23:12:28 +01:00
James E. King III
5e23c4df5b Update changes with removal of compiler plugin [ci skip]. 2019-01-27 00:00:33 -05:00
James E. King III
b96c43892a THRIFT-4717: fix up make clean with autoconf 2019-01-25 23:33:54 -05:00