-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Close TcpTransport on RST in some Spots to Prevent Leaking TIME_WAIT Sockets #26764
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
Changes from 2 commits
feb8f30
f79f008
1ff8d6e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -117,12 +117,12 @@ protected InetSocketAddress getLocalAddress(MockChannel mockChannel) { | |
| @Override | ||
| protected MockChannel bind(final String name, InetSocketAddress address) throws IOException { | ||
| MockServerSocket socket = new MockServerSocket(); | ||
| socket.bind(address); | ||
| socket.setReuseAddress(TCP_REUSE_ADDRESS.get(settings)); | ||
| ByteSizeValue tcpReceiveBufferSize = TCP_RECEIVE_BUFFER_SIZE.get(settings); | ||
| if (tcpReceiveBufferSize.getBytes() > 0) { | ||
| socket.setReceiveBufferSize(tcpReceiveBufferSize.bytesAsInt()); | ||
| } | ||
| socket.bind(address); | ||
| MockChannel serverMockChannel = new MockChannel(socket, name); | ||
| CountDownLatch started = new CountDownLatch(1); | ||
| executor.execute(new AbstractRunnable() { | ||
|
|
@@ -303,6 +303,7 @@ public void accept(Executor executor) throws IOException { | |
| MockChannel incomingChannel = null; | ||
| try { | ||
| configureSocket(incomingSocket); | ||
| incomingSocket.setSoLinger(true, 0); | ||
|
||
| synchronized (this) { | ||
| if (isOpen.get()) { | ||
| incomingChannel = new MockChannel(incomingSocket, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense ++