okhttp: Use a real socket during server transport testing#10281
Merged
ejona86 merged 1 commit intogrpc:masterfrom Jun 15, 2023
Merged
okhttp: Use a real socket during server transport testing#10281ejona86 merged 1 commit intogrpc:masterfrom
ejona86 merged 1 commit intogrpc:masterfrom
Conversation
This was referenced Jun 13, 2023
66c9067 to
9d2b802
Compare
Member
Author
|
CC @YifeiZhuang |
The PipeSocket was convenient and avoided real I/O, but the shutdown/close while connecting/handshaking tests were triggering a Socket bug in Java (https://bugs.openjdk.org/browse/JDK-8278326). Using a real socket doesn't trigger the bug because the test stops sharing state with the code under test. Fixes grpc#10228 ``` Details ================== WARNING: ThreadSanitizer: data race (pid=4528) Write of size 1 at 0x0000cfb9d5f4 by thread T36 (mutexes: write M0): #0 java.net.Socket.setCreated()V Socket.java:687 #1 java.net.AbstractPlainSocketImpl.create(Z)V AbstractPlainSocketImpl.java:149 #2 java.net.Socket.createImpl(Z)V Socket.java:477 #3 java.net.Socket.getImpl()Ljava/net/SocketImpl; Socket.java:540 #4 java.net.Socket.setTcpNoDelay(Z)V Socket.java:998 #5 io.grpc.okhttp.OkHttpServerTransport.startIo(Lio/grpc/internal/SerializingExecutor;)V OkHttpServerTransport.java:164 #6 io.grpc.okhttp.OkHttpServerTransport.lambda$start$0(Lio/grpc/internal/SerializingExecutor;)V OkHttpServerTransport.java:159 #7 io.grpc.okhttp.OkHttpServerTransport$$Lambda$56.run()V ?? #8 io.grpc.internal.SerializingExecutor.run()V SerializingExecutor.java:133 #9 java.util.concurrent.ThreadPoolExecutor.runWorker(Ljava/util/concurrent/ThreadPoolExecutor$Worker;)V ThreadPoolExecutor.java:1130 #10 java.util.concurrent.ThreadPoolExecutor$Worker.run()V ThreadPoolExecutor.java:630 #11 java.lang.Thread.run()V Thread.java:830 #12 (Generated Stub) <null> Previous read of size 1 at 0x0000cfb9d5f4 by thread T35 (mutexes: write M1, write M2): #0 java.net.Socket.close()V Socket.java:1512 #1 io.grpc.okhttp.OkHttpServerTransportTest$PipeSocket.close()V OkHttpServerTransportTest.java:1384 #2 io.grpc.okhttp.OkHttpServerTransportTest.clientCloseDuringHandshake()V OkHttpServerTransportTest.java:290 ```
9d2b802 to
5e5e6a8
Compare
temawi
approved these changes
Jun 15, 2023
Member
|
LGTM. Thanks for the clarification, and sorry! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The PipeSocket was convenient and avoided real I/O, but the
shutdown/close while connecting/handshaking tests were triggering a
Socket bug in Java (https://bugs.openjdk.org/browse/JDK-8278326). Using
a real socket doesn't trigger the bug because the test stops sharing
state with the code under test.
Fixes #10228