Commit Graph

6056 Commits

Author SHA1 Message Date
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
dugenkui
0dd1363931 THRIFT-5190: StringUtils haven't take (offset + length) > bytes.length into account
Client: java
Patch: dugenkui <dugenkui@meituan.com>

This closes #2125
2020-06-28 16:55:16 +02:00
wangyunjian
86cc6f095c THRIFT-5144: Fix memory leak when generate deserialize list element
Client: c_glib
Patch: wangyunjian

This closes #2064

Signed-off-by: wangyunjian <wangyunjian@huawei.com>
2020-06-27 15:25:06 +02:00
Salah Ghanim
24ca210fde Fix README.md typo
Patch: Salah Ghanim

This closes #2186
2020-06-25 22:06:13 +02:00
Jens Geyer
6e16c2bc54 THRIFT-5238 GetHashCode can throw NullReferenceException
Client: netstd
Patch: Jens Geyer

This closes #2187
2020-06-25 22:00:52 +02:00
Emmanuel Brard
283410126c THRIFT-2087 Python compiler replace non utf-8 char with default
Client: py
Patch: Emmanuel Brard

This closes #2184
2020-06-22 22:50:45 +02:00
Duru Can Celasun
bcae3bb52f
THRIFT-5233: Handle I/O timeouts in go library (#2181)
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-18 22:09:33 +01:00
wangyunjian
8b8633e8d8 THRIFT-5221: Fix stack overflow when reading buffer
Client: c_glib
Patch: wangyunjian

This closes #2161

Signed-off-by: wangyunjian <wangyunjian@huawei.com>
2020-06-18 22:23:05 +02:00
Jens Geyer
1bed620c5f THRIFT-5235 Add property setter for isset flags
Client: delphi
Patch: Jens Geyer
2020-06-18 11:22:33 +02:00
Phil Price
7db2d0fa46 THRIFT-5234 Fix a number of js/ts generation issues
Client: js/ts
Patch: Phil Price
2020-06-18 00:37:40 +02:00
Jens Geyer
210202e65c THRIFT-5229 Deprecate as3 support
Client: as3
Patch: Jens Geyer

This closes #2182
2020-06-16 22:04:23 +02:00
Marco Schroeter
7b379944ef Thrift.csproj: Stop writing AssemblyAttributes.cs to /tmp
Client: netstd
Patch: Marco Schroeter

This closes #2167
2020-06-15 22:32:43 +02: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
zeshuai007
26681fbdb7 THRIFT-5225: Use nullptr instead of NULL
Patch: Zezeng Wang

This closes #2168
2020-06-14 14:17:11 +02:00
Stanislav Markevic
3f78c70bbb THRIFT-5082 Add a Class reference for PHP enum $_TSPEC
Client: php
Patch: Stanislav Markevic

This closes #2000
2020-06-09 23:23:02 +02: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
Yuxuan 'fishy' Wang
cfbb905034
THRIFT-5214: Reset read deadline in socketConn
Client: go

This is a slightly different, and less error-prone approach from the
fix in e382275b.

The previous approach relies on passing the set socket timeout into the
underlying socketConn from TSocket and TSSLSocket. But since we have so
many different constructors for TSocket and TSSLSocket, some makes the
initial connection in the constructor and some does not, there are so
many different places we would need to remember to pass socketTimeout
into socketConn. In the future, when we add another constructor to them,
we could either forget to pass the socket timeout into socketConn, or
try to pass it while we haven't constructed socketConn yet (which will
cause panic), both are bad.

In this approach we just clear the read deadline in the connectivity
check read. Because that's a non-blocking read, it would work just fine
without a read deadline.
2020-06-09 21:07:38 +01:00
Yuxuan 'fishy' Wang
e382275bad
THRIFT-5214: Push read deadline in socketConn
Client: go

We added socketConn to go library for connectivity check in
https://github.com/apache/thrift/pull/2153, but forgot to push read
deadline on the socket when doing the connectivity checks. This caused
the issue of large number of connectivity checks to fail with I/O
timeout errors.
2020-06-08 14:06:17 +01:00
Yuxuan 'fishy' Wang
c9890cb873
THRIFT-5214: Partial rewrite of TFramedTransport
Client: go

While debugging the issue in THRIFT-5214, I original thought that was a
bug in TFramedTransport implementation, so I took some time scrutinize
the TFramedTransport code. Although in the end there's no bug, the
current implementation of TFramedTransport, especially in the Read
function, has some weird handling while at frame boundary, which is both
error-prone and hard to follow (I did found and fixed one bug there in
https://github.com/apache/thrift/pull/1810 before).

The new implementation reads the whole frame into a buffer, which would
use slightly more memory, but it follows the pattern of TFramedTransport
implementation of other languages (e.g. Java), and also the pattern we
handle frame in THeaderTransport. It also reduced the complexity and
weirdness of the frame boundary handling in Read implementation.

This rewrite also removes the print call from library code.
2020-06-08 12:32:21 +01:00
Yuxuan 'fishy' Wang
9fd134f269
Use io.CopyN to simplify THeaderTransport code
Client: go

In THeaderTransport implementation, use io.CopyN instead of
io.Copy+io.LimitReader.

Underlying io.CopyN is actually implemented with io.Copy+io.LimitReader
[0], but it also does some extra checks we can take advantage of. It
also simplifies the code in thrift repo.

[0]: 83b181c68b/src/io/io.go (L340)
2020-06-08 12:30:14 +01:00
zeshuai007
0acf23b7cf THRIFT-5200 Thrift compiler will generate incorrect code when add 'cob_style' option
Client: cpp
Patch: Zezeng Wang

This closes #2144
2020-06-04 21:43:30 +02:00
wangyunjian
b1628cf8bc THRIFT-5122: Fix memory leak on accept error in thrift_simple_server_serve()
Client: c_glib
Patch: wangyunjian

This closes #2039

Signed-off-by: wangyunjian <wangyunjian@huawei.com>
2020-06-04 21:25:58 +02:00
Mario Emmenlauer
bde5cbc078 Added IsOpen() and GetPort() for netstd transports
Client: netstd
Patch: Mario Emmenlauer

This closes #2166
2020-06-04 21:18:01 +02:00
Mario Emmenlauer
eac4d0c79a THRIFT-5114 Simplified reallocation of TMemoryBuffer
Client: cpp
Patch: Mario Emmenlauer

This closes #2030
2020-06-03 23:10:36 +02:00
Mario Emmenlauer
fa770f61e9 Use correct platform executable suffix for thrift compiler
Patch: Mario Emmenlauer

This closes #2139
2020-06-02 13:55:03 +02:00
Anton Filippov
68f2194dfa Fix STRERROR_R_CHAR_P cxx check (remove unused variable warning->error)
Client: cpp
Patch: Anton Filippov

This closes #2081
2020-05-30 15:07:56 +02:00
Nathan Breakwell
36bf0a491e Make named pipe security configurable by security descriptor string
Client: cpp
Patch: Nathan Breakwell

This closes #2083
2020-05-30 14:59:48 +02:00
Jens Geyer
b559359b0b THRIFT-5220 DeepCopy() extension methods not generated when the IDL contains no service
Client: netstd
Patch: Jens Geyer
2020-05-28 21:32:34 +02:00
Jens Geyer
98854c4874 Updated LICENSE file 2020-05-28 21:32:33 +02:00
Jens Geyer
affea7bee4 THRIFT-5216 generate DeepCopy methods
Client: netstd
Patch: Jens Geyer

This closes #2155
2020-05-27 01:32:14 +02:00
Yuxuan 'fishy' Wang
05023e81b2
THRIFT-5214: Connectivity check on go's TSocket
Client: go

Implement connectivity check on go's TSocket and TSSLSocket for
non-Windows systems.

The implementation is inspired by
https://github.blog/2020-05-20-three-bugs-in-the-go-mysql-driver/
2020-05-26 23:31:20 +01:00
Eric Chen
d28f39fbc7 THRIFT-5129: Fix swift TSocketTransport on Mac
Client: Swift
Patch: Eric Chen

This closes #2149
2020-05-26 21:57:13 +02:00
Eric Chen
0198542201 THRIFT-5195: Handle Thrift union type sending for Swift
Client: Swift
Patch: Eric Chen

This closes #2154
2020-05-26 21:52:05 +02:00
zeshuai007
797fe252e0 Supplement TNonblockingServer.py testcase
Client: py
Patch: Zezeng Wang

This closes #2150
2020-05-26 21:46:16 +02:00
James Lacey
e6d7d13c35 THRIFT-5215: Remove portable_endian.h
Client: cpp
Patch: James Lacey

This closes #2152
2020-05-26 21:35:19 +02:00
Jens Geyer
eb8e8437a5 addition to THRIFT-5185: Support for using WebSockets as a server transport
to satisfy https://www.apache.org/legal/src-headers.html#3party
2020-05-22 01:12:24 +02:00
zeshuai007
348790deaf THRIFT-5147: Add uninstall function
Patch: Zezeng Wang

This closes #2066
2020-05-21 12:49:57 +02:00
David Mollitor
528c22f59d THRIFT-5201: Use Apache Parent Pom for Thrift Maven Plugin
Client: Java
Patch: David Mollitor

This closes #2136
2020-05-21 12:34:46 +02:00
rel1ve
dd34c52813 When I use --with-zlib args for cross-compiling, it failed without "$(ZLIB_LDFLAGS)".
build system
Patch: rel1ve <rel1ve@hotmail.com>

This closes #2056
2020-05-21 12:32:27 +02:00
David Mollitor
f8103c69ea THRIFT-5202: TNonblockingMultiFetchClient Use SLF4J Parameterized Logging
Client: java
Patch: David Mollitor

This closes #2137

Use SLF4J API to log full Exception details.  Use SLF4J parameterized logging instead of String format.
2020-05-20 09:26:36 -04: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
Jano Svitok
4fd001c878 THRIFT-5138 Swift keywords may be used as identifiers if escaped
Client: Swift
Patch: Jano Svitok

This closes #2059
2020-05-20 00:48:35 +02:00
Jano Svitok
a082592d43 THRIFT-5128 Swift TFramedTransport does not work using present code
Client: Swift
Patch: Jano Svitok

This closes #2047
2020-05-20 00:39:49 +02:00
Jano Svitok
1edf32926d THRIFT-5125: Swift server does not work using present code
Client: Swift
Patch: Jano Svitok

This closes #2038
2020-05-20 00:28:58 +02:00
Jens Geyer
506e311c38 FIX: CI error at ./test/py/TestServer.py:178:26: F507 '...' % ... has 1 placeholder(s) but 6 substitution(s)
FIX: CI error at ./test/crossrunner/compat.py:11:21: E741 ambiguous variable name 'l'
Patch: Jens Geyer

This closes #2147
2020-05-19 00:00:29 +02:00
penenin
1ab096c80a
THRIFT-5185: Support for using WebSockets as a server transport
Client: cpp
2020-05-18 20:27:31 +01:00
Jens Geyer
dce229911c THRIFT-5210 further refactoring and performance optimizations
Client: netstd
Patch: Jens Geyer

This closes #2146
2020-05-17 22:34:10 +02:00
Philipp Hausmann
261de348fe THRIFT-5211 Handle incomplete reads correctly
Client: Haskell
Patch: Philipp Hausmann

This closes #2108

The read functions for handles promise to return *up* to the requested
number of bytes. This means in case we read less bytes, we should try
again to read some more bytes.
2020-05-17 14:44:59 +02:00
zeshuai007
53239655b7 THRIFT-3622 Fix deprecated uses of std::auto_ptr
Client: cpp
Patch: zeshuai007 <51382517@qq.com>

This closes #2135
2020-05-15 22:22:48 +02:00