| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
This reverts commit b39370ec3bc96d201bbc82fbde136f98ae605ed1, and also
adds a test case for THRIFT-5685.
|
|
|
|
|
| |
Those come with nocopy protection, so they can prevent bugs like people
passing the types by value instead of by pointer from the compiler.
|
|
|
|
|
| |
Following our policy regarding supported go releases, change the
supported go versions to 1.19.* and 1.20.* with the release of go 1.20.
|
|
|
|
|
|
|
|
|
| |
Client: go
While https://github.com/apache/thrift/pull/951 fixed the bug with
forward typedef used in container values, it also introduced a bug that
broke forward typedef used in other cases in go code. Limit the fix of
it to only the container key and value types to fix other cases.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Client: go
The go library itself does not have any third-party dependencies. We
have one third party dependency from the test code, which kind of
polluted from top-level go.mod file to the users of thrift go library.
We previous tried to clean that up by creating go.mod file at
lib/go/thrift, which caused issues to the release process and thus
reverted.
Use multi-module to separate tests requiring mock to their own modules
so that we can keep the top-level go.mod file clean.
Also some minor fixes on the github actions go workflow.
|
|
|
|
| |
Client: go
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Client: go
This is only the library part of THRIFT-5650. I still have some open
questions for the compiler part so that will be done later.
While I'm here, also made some changes to go CI process:
* Update ubuntu-bionic to use go 1.18 for travis
* Update ubuntu-jammy to use the latest go 1.19.x for travis
* Run both go 1.18 and 1.19 for github actions
* Also run test/go tests for github actions
|
|
|
|
| |
Closes https://github.com/apache/thrift/pull/2469.
|
| |
|
|
|
|
| |
the partially completed uuid implementation to master
|
|
|
|
|
|
|
|
|
|
| |
Since we dropped support of Go 1.18-, use generic to avoid dealing with
type assertions with interface{}/any.
While I'm here, also remove the usages of ioutil, as that's officially
marked as deprecated in Go 1.19.
Client: go
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
Client: go
Also provide generic version of Pointer helper function.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
Client: go
Make it unwrap to context.Canceled, since the main use case of it is to
be returned in lieu of context.Canceled to avoid extra writing to the
client, so that if user has any processor middleware that checks for
context.Canceled error those would still work.
|
|
|
|
|
|
|
| |
Client: go
This was a copy-paste error in the original implementation in
6583f4e52345c3b05a76f0b188836599628356e8.
|
|
|
|
| |
Client: go
|
|
|
|
|
|
|
| |
Per our support policy, drop support of go 1.16 and add support of go
1.18.
Also enable go vet in make check, and fix issues reported by go vet.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
Client: go
This allows ProcessorMiddlewares to access such exceptions, unless
there's a network error writing the response (which takes priority).
While I'm here, also make the indentation of Process function more
consistent, and make it consistent on returning false and an error when
the reading/writing fails.
|
|
|
|
| |
Client: go
|
|
|
|
|
|
|
|
|
|
| |
Client: go
This is a follow up of 6f33b0470. After we proactively closed the client
connection, processor.Process could return NOT_OPEN as a result, and
those errors being logged will cause the log to be very noisy.
This will also be cherry-picked into 0.16.0 branch.
|
|
|
|
|
|
|
|
|
| |
Client: go
When the connectivity check failed in IsOpen, close the connection
explicitly to avoid connection leaks.
This is Path 2 of THRIFT-5509.
|
| |
|
|
|
|
|
|
|
|
|
| |
Client: go
We used to rely on setting the connection inside TSocket/TSSLSocket as
nil after Close is called to mark the connection as closed, but that is
not thread safe and causing TSocket.Close/TSSLSocket.Close cannot be
called concurrently. Use an atomic int to mark closure instead.
|
|
|
|
|
|
|
|
| |
Client: go
This is a trivial unit test improvement from the last commit. Of course
I only discovered the existence of testing/iotest package after I
re-invented the wheel.
|
|
|
|
|
|
|
|
|
| |
Client: go
Follow up on d582a8614, do the same thing on TFramedTransport.
Also update the test on the implementation of THeaderTransport to make
sure that small reads are not broken.
|
|
|
|
|
|
|
|
|
| |
Client: go
Instead of binding 2 buffers (read/write) to each THeaderTransport, grab
one from the pool to be used for the whole read/write, and return it
back to the pool after the read/write is done. This would help reduce
the memory footprint from idle connections.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
Client: go
Update go versions used in travis to 1.16.7 and 1.17, update
LANGUAGES.md, and update go's README to clarify on support policy.
This change will be cherry-picked into 0.15.0 branch after merged.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
Client: go
The current compiler will generate uncompilable code when we use
optional enum and/or typedef'd types in a thrift constant.
This fixes the issue, also adds a test for that.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Because we briefly had go.mod file under lib/go/thrift in e27e82c46b
(it was later removed in d9fcdd3dba), using
go get github.com/apache/thrift/lib/go/thrift/...
(as suggested by the current README) will get that particular version
instead of the latest released version. So update README to use
go get github.com/apache/thrift
instead.
Also instead of saying we support Go 1.7+, say we support the officially
supported Go releases, as that's our new support policy.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Client: go
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Client: go
This unblocks the development under go 1.16+, which starts to complain
when there's no go.mod file in any of the directories.
The current approach is certainly not the best solution ever, for
example it does not run the tests under lib/go/test/tests but copy them
into lib/go/test/gopath/src/sometest and run them there instead, but
those improvements can be done in the future in follow up PRs and this
should be a good enough first step to unblock developments.
|
| |
|
|
|
|
| |
avoids a timeout on malformed input found by fuzzing
|
|
|
|
|
|
|
| |
Client: go
Also add missing copyright header for files added in
https://github.com/apache/thrift/pull/2307.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Client: go
There is a duplicate elements check for set in writeFields* function,
and it compares elements using reflect.DeepEqual which is expensive.
It's much faster that generates a *Equals* function for set elements and
call it in duplicate elements check, especially for nested struct
element.
Closes #2307.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Client: go
This fixes a bug introduced in
https://github.com/apache/thrift/pull/2296, that we mixed the preferred
proto id and the detected proto id, which was a bad idea.
This change separates them, so when we propagate TConfiguration, we only
change the preferred one, which will only be used for new connections,
and leave the detected one from existing connections untouched.
Also add a test for it.
|
|
|
|
|
|
|
|
| |
Client: go
Having it under a subdirectory has some unexpected consequences, so
remove it for now. Another PR will be open up later to add it back to
the root directory.
|
|
|
|
|
|
|
|
|
| |
Client: go
- Update Dockerfiles used by travis
- Add go.mod file
- Modify error handling code to take advantage of errors package updates
in go1.13
|