Commit Graph

6103 Commits

Author SHA1 Message Date
Duru Can Celasun
077b5fce82
go: Use sync.Pool for gzip in HTTP transport
b67cad4 introduced transparent gzip support for the HTTP transport but
calling gzip.NewWriter() with every request causes a large number of
memory allocations [1] and can create GC pressure.

Avoid this by using a sync.Pool for gzip writers.

[1] https://old.reddit.com/r/golang/comments/9uejp4/usage_of_syncpool_for_gzipwriter_in_http_handlers/e94jh8c/
2020-09-30 07:25:51 +01:00
zeshuai007
062521f3b6 add the test case into cmake 2020-09-28 14:31:07 +08:00
Dedipyaman Das
6fd830d690 THRIFT-4942 Set PHP struct generated field values as private with getters and setters
Client: php
Patch: Das Dedipyaman

This closes #2245

Update field access for getters_setters flag. FFields are private if getters_setters are set, otherwise, public.
2020-09-27 12:04:43 +02:00
Dedipyaman Das
c553155af8 THRIFT-4942 Set PHP struct generated field values as private with getters and setters
Client: php
Patch: Das Dedipyaman

This closes #1859
This closes #2238
2020-09-25 22:04:41 +02:00
Yuxuan 'fishy' Wang
6dcd64ee5c THRIFT-5279: Go serializer/deserializer cleanups
Client: go

Cleanup the default NewTSerializer and NewTDeserializer implementations
to save an unnecessary allocation, and provide
NewTSerializerPoolSizeFactory and NewTDeserializerPoolSizeFactory for
easier non-default pool usages.
2020-09-23 09:16:42 -07:00
Yuxuan 'fishy' Wang
a2c44665b4 THRIFT-5278: Allow set protoID in go THeader transport/protocol
Client: go

In Go library code, allow setting the underlying protoID to a
non-default (TCompactProtocol) one for THeaderTransport/THeaderProtocol.
2020-09-22 16:48:38 -07:00
Zezeng Wang
03f4729f7c
Merge pull request #2235 from deiv/fix-abstract-unix-socket-name
Fix abstract unix socket name
2020-09-22 09:35:39 +08:00
David Suárez
4750f361c8 Fix abstract unix socket name
For the abstract unix socket address type, the string in the
'sun_path' field of the 'sockaddr_un' struct, is a not null-terminated
string (see unix(7)).

Fix the lentgh calculation of the 'sun_path' field to not add
the termination null byte.
2020-09-21 11:36:36 +02:00
David Mollitor
e29c39f921 THRIFT-5203: Remove Unused toString Method in TSerializer
Client: cpp
Patch: David Mollitor

This closes #2138
2020-09-20 19:11:39 +02:00
Jens Geyer
25f8d5385f fix CI: add Erlang crashes to known failures 2020-09-20 19:07:04 +02:00
Zezeng Wang
d5e5fd0c54
Merge pull request #2221 from zeshuai007/THRIFT-5249
THRIFT-5249 Fix Failed to run FastbinaryTest.py
2020-09-19 11:59:11 +08:00
zeshuai007
e6d97c0f66 test ci fix 2020-09-19 09:23:58 +08:00
Zezeng Wang
119030848c
Merge pull request #2191 from zeshuai007/Implements_TConfig
THRIFT-5237 Implement MAX_MESSAGE_SIZE and consolidate limits into a TConfiguration class(JAVA)
2020-09-18 16:05:44 +08:00
wangyunjian
c77941c60d THRIFT-5134: Fix memory leak when the handler method return FALSE
Client: c_glib
Patch: wangyunjian

This closes #2049

Signed-off-by: wangyunjian <wangyunjian@huawei.com>
2020-09-17 11:34:17 +02:00
zeshuai007
0d6a2d36ea THRIFT-4272: warnings in glibc library
Client: c_glib
Patch: Zezeng Wang

This closes #2067
2020-09-17 11:30:32 +02:00
Jens Geyer
dbc4fbf4fe fix CI: add Erlang crashes to known failures 2020-09-17 09:55:07 +02:00
zeshuai007
63213c17ad Implements TConfiguration for java 2020-09-16 18:37:40 +08:00
Mario Emmenlauer
dd6c8c1069 TServerSocket.cpp: Ensure the server is really listening (via helper variable listening_)
Client: cpp
Patch: Mario Emmenlauer

This closes #2232
2020-09-15 20:39:44 +02:00
Mario Emmenlauer
40cd0215f1 Added getter and setter for domain socket path, and minor fix for printing abstract domain socket paths
Client: cpp
Patch: Mario Emmenlauer

This closes #2233
2020-09-15 09:03:56 +02:00
Jonathan Mackenzie
304f50b39f
Fixed double newline at end of generated python service files (#2236)
Generated python files have a blank line at the end of files, except for
service files where there are two blank lines, this change makes these
service files consistent.

This change is trivial and thus does not require a ticket.
2020-09-14 09:11:07 -07:00
Jens Geyer
413377bbbc fix CI: add Erlang crashes to known failures 2020-09-12 19:18:36 +02:00
zeshuai007
6b1cb30f48 THRIFT-5217 Deprecated boost header
Client: cpp
Patch: Zezeng Wang

This closes #2158
2020-09-12 19:07:28 +02:00
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