-
Notifications
You must be signed in to change notification settings - Fork 4.1k
UUID Cross test debugging and observations #3144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
- Not interested in these now and looked more involved to solve - d: complains about some libss missing linker object - dart: complains about an sdk version - lisp: some compile error
- Configure and build issues - Ask to run "go mod tidy" without these
- Replace with proper os function
- UUID support was added
- Need to see it to compare to Java and C++
- And print what is sent
- To assist in debugging and writing up the findings
Hello @CJCombrink, Your assumption that C++, Go, and .NET show the correct implementation is right and 00112233-4455-6677-8899-aabbccddeeff is indeed how Wireshark should display the data on the network capture. Hope it helps. |
what you observed sounds like the conversion between unsigned and signed int8 went wrong. I know java does not have unsigned ints and probably had something implemented wrong because of that, not sure if swift has a similar issue. |
The NET impl was the original reference impl I made. Both Delphi and Haxe were then tested against that reference (and each other of course). It's always a good idea to have an implementation ready to for testing that is known to work so maybe someone missed that ... ticket?
"It does not work" is not an adequate problem description. Because "it works for me". 😁. If you need help with this, we can continue that topic at the user or dev mailng list. |
This was my starting point but since I have to integrate my server (c++) with a Java client I tested and found the issue. Same language client <-> server all seems fine, probably because implementation bias where the same mistake is made both sides presents as working code.
I have checked with Wireshark and this is what I see for the C++ Server and the .Net Client: And for C++ server and Java Client: The .Net client sends the data as expected |
@CJCombrink Anyway, the second capture confirm that the data on the network is in the wrong order (while the raw data is correct in the first capture). Edit: I might have misread the image, maybe you should right-click on the packet and select "Decode as…" then select Thrift for the reassembly to work properly (if the client is sending unbuffered in frames 1xx to 128 and the server is sending the reply buffered in frame 130). |
The question is what is the path forward?
|
@CJCombrink path forward is likely to file bugs on jira about java's and swift's implementations of uuid are not according to the spec, and/or fix them via PRs. |
This should be fairly easy to do but that would be a definite backwards compatibility break for users of the UUID field and I am not sure how thrift users would appreciate that. If the adoption of UUID is low it should not be an issue. |
since there's already a divergence, there's no way to fix this without any braking changes. and it's certainly better to break the ones not according to spec, vs. breaking things that's according to the spec. |
You don't want to break an incompatible implementation for compatibility reasons? 🤣 |
Is there a way to use the existing cross tests to test this compatibility? My current idea would be that each client must send the known pattern |
We run a small subset of languages on the CI, the ones implemented uuid use but almost all languages, even the ones we don't currently run ci, have crossrunner setup there, and you can just use crossrunner locally to run the crosstests between them. |
Yes I am aware of this, my observation is that these tests does run compatibility tests, but not correctness tests. For example, when running the cross test with java server and cpp client (locally, on this branch)
Then looking at the following test result:
And in the logs for "Server": (
The logs for "Client": (
Ultimately the test should fail, or an alternative test or method should be introduced to try and catch this. I will see if I can't start the process to submit a fix for the Java |
- Tries to run the debug build but it appears that the script builds release
yea I think you are right. I checked go's cross test server and client implementation, the server just response the same uuid it received back to the client, and the client just checks that the uuid it received back is the same one it sent out, so this would not fail the test if the server is using the wrong order. I would assume other languages' test client and test server are implemented similarly. we would need to check the value on the server against a pre-defined value to catch this bug. |
We could have three small files somewhere under |
Actually I think that road leads to no good. I hardcoded the testcases now and made it as simple as possible (even though the commit size may indicate otherwise) @CJCombrink commits are 3e6be73 and a420a24 |
Trying to get cross tests to work:
@Jens-G I am trying to investigate a possible issue with the UUID type between implementations.
These are some changes I had to make to get me going. If you perhaps have some time to look through and maybe comment or consider why the CI build does not need these changes.
I am following the steps as per Raw Commands for Building with Docker
My current observation is that the Java and Swift implementation of UUID is not correct as per the spec: Universal unique identifier encoding
My current test includes running one server and running another client.
What I observe: I check the UUID being sent by the client and the UUID as reported by the server. In all cases the expectation is that what is sent is received and then returned. This however is not the case.
For all of these I am running the C++ server:
/thrift/src/test/cpp/TestServer --port=37471
00112233-4455-6677-8899-aabbccddeeff
00112233-4455-6677-8899-aabbccddeeff
/thrift/src/test/cpp/TestClient --port=37471
00112233-4455-6677-8899-aabbccddeeff
8899aabb-ccdd-eeff-0011-223344556677
/thrift/src/lib/java/build/runclient --port=37471
00112233-4455-6677-8899-aabbccddeeff
00112233-4455-6677-8899-aabbccddeeff
/thrift/src/test/go/bin/testclient --port=37471
00112233-4455-6677-8899-aabbccddeeff
8899aabb-ccdd-eeff-0011-223344556677
thrift/src/test/swift/CrossTests/.build/x86_64-unknown-linux-gnu/debug/TestClient --port=37471
00112233-4455-6677-8899-aabbccddeeff
00112233-4455-6677-8899-aabbccddeeff
/thrift/src/test/netstd/Client/bin/Release/net9.0/Client
That about covers the php support except for Haxe and Delphi as per the LANGUAGES.md (I am having trouble building Delphi as seen in the cross-test.sh script.
From the above at least the C++, go and .NET implementations are compatible (and I would argue correct)
NB: This is not about what the client sends and receives: The client that sends the UUID receives the same UUID which means the server re-transmits as-is. The issue is about what one langauge sends (encode) and what another language receives (decode).
Where to from here?
[skip ci]
anywhere in the commit message to free up build resources.