Commit Graph

69 Commits

Author SHA1 Message Date
Jens Geyer
5656208a20 release 0.19.0 2023-08-27 15:45:30 +02:00
Jens Geyer
30b31aaecb Release 0.19.0 2023-07-15 11:48:39 +02:00
Jens Geyer
f5a67528d8 Release 0.19.0 2023-07-15 11:32:12 +02:00
Jens Geyer
1851da53a3 Release 0.18.1 2023-02-23 21:18:07 +01:00
Jens Geyer
423ab3997d bump version 2023-02-15 22:20:10 +01:00
Jens Geyer
2f2696bdf6 release branch 0.18.0 2023-02-07 00:12:09 +01:00
Jens Geyer
383e4ad046 CHANGES.md updated 2022-08-30 23:58:36 +02:00
Yuxuan 'fishy' Wang
7ae180bb1e THRIFT-5609: Make TJSONProtocol safe to be used in deserializer pool
Client: go

Add Reset to TJSONProtocol, and call it in deserializer and serializer
to make sure that it's always safe to be used in the pool version.
2022-08-06 07:45:27 -07:00
Yuxuan 'fishy' Wang
892b6731ee THRIFT-5605: Client middleware to extract exceptions
Client: go

Provide ExtractIDLExceptionClientMiddleware client middleware
implementation and ExtractExceptionFromResult to extract exceptions
defined in thrift IDL into err return so they are accessible from other
client middlewares.
2022-08-02 11:25:51 -07:00
Yuxuan 'fishy' Wang
dae1437ca0 THRIFT-5583: Add skip_remote arg to go compiler
Client: go
2022-05-10 08:57:22 -07:00
Yuxuan 'fishy' Wang
6433994ee7 THRIFT-5539: Decouple TDuplicateToProtocol out of TDebugProtocol
Client: go

Currently go's TDebugProtocol does two things: log the read/writes, and
duplicate all the reads/writes to another TProtocol. For people who only
need the second feature, even if they use NopLogger for the logging
part, they still need to pay the price of all the fmt.Sprintf calls used
by logging, and on some cases those fmt.Sprintf calls alone can cause
significant CPU to be wasted (in one of our services fmt.Sprintf called
by TDebugProtocol used ~10% of CPU).

Create a dedicated TDuplicateToProtocol to reduce cpu waste, and mark
TDebugProtocol.DuplicateTo as deprecated.
2022-03-15 21:39:38 -07:00
Jens Geyer
2a93df80f2 Update changelog for 0.16.0 2022-02-09 20:46:41 +01:00
Jens Geyer
f18a8f34e2 Update changelog for 0.16.0 2022-02-04 22:38:03 +01:00
Jens Geyer
d68f03c0ed Updated changes.md for 0.16.0 2022-01-27 08:55:23 +01:00
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