Commit Graph

6315 Commits

Author SHA1 Message Date
Yuxuan 'fishy' Wang
2676327f6e Add DuplicateTo protocol to go's TDebugProtocol
This also comes from the discussion of
https://github.com/apache/thrift/pull/1992#issuecomment-705903922.
I think TDebugProtocol is a better fit for this feature than creating a
new TProtocol implementation.

The DuplicateTo field is not added to TDebugProtocolFactory because I
don't think it makes sense from the factory setup. In vast majority
cases users would need direct access to the underlying TMemoryBuffer to
make it useful, which is easier this way than an additional
TTransportFactory plus TProtocolFactory to make TDebugProtocolFactory
way too complicated.
2020-10-19 14:21:44 -07:00
Yuxuan 'fishy' Wang
64c2a4b87a THRIFT-5294: Fix panic in go TSimpleJSONProtocol
Client: go

In go library's TSimpleJSONProtocol and TJSONProtocol implementations,
we use slices as stacks for context info, but didn't do proper boundary
check when peeking/popping, result in it might panic with using -1 as
slice index in certain cases of calling Write*End without matching
Write*Begin before.

Refactor the code to properly implement the stack, and return a
TProtocolException instead on those cases.

Also add unit tests for all protocols. The unit tests shown that
TCompactProtocol.[Read|Write]StructEnd would also panic with unmatched
Begin calls, so fix them as well.
2020-10-14 10:14:03 -07:00
Yuxuan 'fishy' Wang
daf6209157 THRIFT-5240: Tweak the default go server connectivity check interval
Client: go

This is a follow up to 4db7a0af13.

Because of the Go runtime bug [1], the previous default value of 1ms is
not a great default as it could cause excessive cpu usage. Use 5ms
instead as a balance between being useful and not causing too much cpu
overhead.

It's still configurable.

[1]: https://github.com/golang/go/issues/27707
2020-10-07 22:25:19 -07:00
Jens Geyer
6d570260ca THRIFT-5290 Adjusting cpp *.cproj options according to LEGAL-538
Client: cpp
Patch: Jens Geyer

This closes #2250
2020-10-06 22:17:42 +02:00
David Mollitor
d89b427d19 THRIFT-5287: Log When Client Connections are Dropped
Client: java
Patch: David Mollitor

This closes #2253
2020-10-04 22:18:13 +02:00
Jeffrey Han
5751ddf2ac THRIFT-5286: Fix Lua library readBool() in TCompactProtocol
Client: Lua
Patch: Jeffrey Han

This closes #2252
2020-10-02 22:02:56 +02:00
Kashirin Alex
330482b02e markdown compiler added
Client: md
Patch: Kashirin Alex

This closes #2241
2020-10-02 21:52:43 +02:00
guanjialin
1d68bfe3c4 Rust compiler generates invalid code when using typedef with union
Client: rs
Patch: guanjialin <1406147701@qq.com>

This closes #2228
2020-10-01 23:11:11 +02:00
Stoyan Markov
44b0b5d3c9 THRIFT-5103: Fix for PHP7.4 deprecated syntax
Client: php
Patch: Stoyan Markov

This closes #2230
2020-10-01 23:02:51 +02:00
wangyunjian
fa22f34e74 THRIFT-5256: Fix some compile warnings
Client: c_glib
Patch: wangyunjian

This closes #2207

Signed-off-by: wangyunjian <wangyunjian@huawei.com>
2020-10-01 23:00:11 +02:00
Christopher Chavez
03f01fba18 Fix c_glib implicit function declarations
Client: c_glib
Patch: Christopher Chavez

This closes #2249
2020-10-01 22:43:54 +02:00
Tom Wieczorek
b1a5cd6542 Fix typo 2020-09-30 10:20:19 -07:00
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