Commit Graph

6331 Commits

Author SHA1 Message Date
longzhiri
03715899d2 THRIFT-5260 Fix the thrift compiler generate problematic lua code for the oneway method
Client: lua
Patch: longzhiri <persistentsnail@gmail.com>

This closes #2212

The oneway method's processor has no need to write the result to client, but it is necessary to return values of each handler's return.
2020-09-12 19:01:36 +02: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
Allen George
b0d14133d5 THRIFT-5158 Update Rust generator and Rust lib,test,tutorial to only support 2018 edition
Client: rs
Patch: Allen George

This closes #2078
2020-09-02 09:03:40 +02:00
wangyunjian
935770c6b0 THRIFT-5136: Fix memory leak in thrift_multiplexed_processor_process_impl()
Client: c_glib
Patch: wangyunjian <wangyunjian@huawei.com>

This closes #2052

Signed-off-by: wangyunjian <wangyunjian@huawei.com>
2020-09-02 08:54:35 +02:00
wangyunjian
073166f2c4 THRIFT-5255: Fix stack overflow in framed transport
Client: c_glib
Patch: wangyunjian <wangyunjian@huawei.com>

This closes #2206

Signed-off-by: wangyunjian <wangyunjian@huawei.com>
2020-09-02 08:49:42 +02:00
Zero
021cb27070 THRIFT-5259 Fix "Transport endpoint is not connected " error when running lua test server accepts a connection
Client: lua
Patch: Zero <longzhiri@gmail.com>

This closes #2211
2020-08-31 22:52:39 +02:00
longzhiri
21b3e46993 THRIFT-5262 Fix a encoding struct bug in the compact protocol implementation to lua
Client: lua
Patch: longzhiri <persistentsnail@gmail.com>

This closes #2214
2020-08-31 22:46:43 +02:00
zeshuai007
cc41c29c08 Fix appveryor check
Patch: Zezeng Wang

This closes #2220
2020-08-31 22:41:45 +02:00
zeshuai007
3a03da53af THRIFT-5268 Fix some file loss ")" in define
Client: c_glib
Patch: Zezeng Wang

This closes #2218
2020-08-31 22:37:01 +02:00
Yuxuan 'fishy' Wang
22b6c0c8bb THRIFT-5270: Fix wrong int to string conversions
Client: go

Starting from go 1.15, go test starts to complain about wrongly used int
to string conversions:

    ./field.go:58:83: conversion from int to string yields a string of one rune, not a string of digits (did you mean fmt.Sprint(x)?)
    ./numeric.go:72:12: conversion from int64 to string yields a string of one rune, not a string of digits (did you mean fmt.Sprint(x)?)
    ./json_protocol_test.go:612:92: conversion from int to string yields a string of one rune, not a string of digits (did you mean fmt.Sprint(x)?)
    ./simple_json_protocol_test.go:685:96: conversion from int to string yields a string of one rune, not a string of digits (did you mean fmt.Sprint(x)?)

json_protocol_test and simple_json_protocol_test usages are actually
already in format arg so just remove the conversion is good enough.
field is no longer used anywhere so just removed it (there's one line of
commented out code in compact_protocol so remove that line as well). The
one in numeric.go is actually a bug. We didn't set sValue correctly in
NewNumericFromI64 and NewNumericFromI32 functions.
2020-08-29 09:38:13 -07:00
panivko
0503fc0112 THRIFT-5132 Warning in TSocket when using ssl connection
Client: PHP
Patch: Vladimir Panivko

This closes #2160
2020-08-25 21:58:10 +02:00
zeshuai007
c80b8bbe70 THRIFT-5237 Implement MAX_MESSAGE_SIZE and consolidate limits into a TConfiguration class
Client: c_glib
Patch: Zezeng Wang

This closes #2208
2020-08-07 16:54:14 +02:00
Neil Williams
01d53f483a THRIFT-5248: Python: Make TSocket.isOpen check if server still connected
Client: py

This is inspired by changes to the Go library (THRIFT-5214) and, by
proxy, this blog post[1]. The idea is that if the other end of the
socket has closed their end of the connection, we can figure that out by
doing a non-blocking read on our socket before we waste time serializing
and sending a message just to find out the socket is closed when we try
to read the response.

[1]: https://github.blog/2020-05-20-three-bugs-in-the-go-mysql-driver/
2020-08-06 08:27:55 -07:00
Jens Geyer
68c1506715 THRIFT-5261 Support for deprecated methods (via annotation)
Client: Delphi
Patch: Jens Geyer

This closes #2213
2020-08-05 11:55:00 +02:00
Yuxuan 'fishy' Wang
b93fafd327 THRIFT-5214: Use peek to implement socket connectivity check
Client: go

In previous implementation of socket connectivity check, we try to read
1 byte and put it into buffer when succeeded. The buffer complicates
the implementation of Read function. Change to use syscall.Recvfrom with
MSG_PEEK flag instead so that the buffer is no longer needed.
2020-08-03 10:48:24 -07:00
Yuxuan 'fishy' Wang
64f419b5ad THRIFT-5257: Fix Go THeaderTransport endOfFrame handling
Client: go

In the current implementation, we only call endOfFrame when we hit EOF
when reading from the frameReader. The problem is in go stdlib the Read
call finished reading the remaining data from frameReader will not
return EOF, the next Read will. This caused us in most cases only call
endOfFrame at the beginning of the next frame, which could cause
troubles because we didn't read the beginning of the frame properly.
2020-07-29 12:42:37 -07:00
zeshuai007
86352b4821 THRIFT-5237 Implement MAX_MESSAGE_SIZE and consolidate limits into a TConfiguration class
Client: cpp
Patch: Zezeng Wang

This closes #2185
2020-07-25 12:13:53 +02:00
Jens Geyer
23c8e52fa0 THRIFT-5254 Member name cannot be Isset (unless it is an "required" member)
Client: netstd
Patch: Jens Geyer

This closes #2203
2020-07-16 08:51:36 +02:00
Jens Geyer
363ee0001f THRIFT-5253 using Result in result name generates wrong IAsync interface
Client: netstd
Patch: Jens Geyer

This closes #2202
2020-07-16 08:51:20 +02:00
Jens Geyer
58e655e4b9 THRIFT-5252 Make CreateHttpClientHandler() method virtual
Client: netstd
Patch: Jens Geyer

This closes #2201
2020-07-14 21:41:36 +02:00
Jens Geyer
ec57271d5b THRIFT-5251 StringUtils<T>.ToString() raises an exception for enum values outside range
Client: Delphi
Patch: Jens Geyer
2020-07-13 23:42:45 +02:00
zeshuai007
eb45c2a1e4 THRIFT-5247 Avoiding meaningless System.copy
Client: java
Patch: Zezeng Wang

This closes #2196
2020-07-07 22:18:07 +02:00
dugenkui
dd0918713d Fix FrameWriter.java typo
Client: java
Patch: dugenkui <dugenkui@meituan.com>

This closes #2193
2020-07-03 23:36:13 +02:00
wangyunjian
761a869e05 THRIFT-5118: Fix memory leak when the handler method return a exception
Client: c_glib
Patch: wangyunjian

This closes #2035

Signed-off-by: wangyunjian <wangyunjian@huawei.com>
2020-07-01 23:18:03 +02:00
ResDiaryLewis
6c5f5c8a94 THRIFT-5329: Add THttpTransport constructor with HttpClient
Client: netstd
Patch: Lewis Jackson

This closes #2188
2020-07-01 22:59:16 +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
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