GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Kqueue: Deregister filters before closing the fd to avoid hitting a r… · netty/netty@270852b

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • transport-classes-kqueue/src/main/java/io/netty/channel/kqueue
    • AbstractKQueueStreamChannel.java
    • KQueueSocketChannel.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎transport-classes-kqueue/src/main/java/io/netty/channel/kqueue/AbstractKQueueStreamChannel.java‎

Copy file name to clipboardExpand all lines: transport-classes-kqueue/src/main/java/io/netty/channel/kqueue/AbstractKQueueStreamChannel.java
-7Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
import java.net.SocketAddress;
4343
import java.nio.ByteBuffer;
4444
import java.nio.channels.WritableByteChannel;
45-
import java.util.concurrent.Executor;
4645

4746
import static io.netty.channel.internal.ChannelUtils.MAX_BYTES_PER_GATHERING_WRITE_ATTEMPTED_LOW_THRESHOLD;
4847
import static io.netty.channel.internal.ChannelUtils.WRITE_STATUS_SNDBUF_FULL;
@@ -501,12 +500,6 @@ private static void shutdownDone(ChannelFuture shutdownOutputFuture,
501500
}
502501

503502
class KQueueStreamUnsafe extends AbstractKQueueUnsafe {
504-
// Overridden here just to be able to access this method from AbstractKQueueStreamChannel
505-
@Override
506-
protected Executor prepareToClose() {
507-
return super.prepareToClose();
508-
}
509-
510503
@Override
511504
void readReady(final KQueueRecvByteAllocatorHandle allocHandle) {
512505
final ChannelConfig config = config();
Collapse file

‎transport-classes-kqueue/src/main/java/io/netty/channel/kqueue/KQueueSocketChannel.java‎

Copy file name to clipboardExpand all lines: transport-classes-kqueue/src/main/java/io/netty/channel/kqueue/KQueueSocketChannel.java
-32Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,9 @@
2222
import io.netty.channel.socket.ServerSocketChannel;
2323
import io.netty.channel.socket.SocketChannel;
2424
import io.netty.channel.unix.IovArray;
25-
import io.netty.util.concurrent.GlobalEventExecutor;
2625

2726
import java.net.InetSocketAddress;
2827
import java.net.SocketAddress;
29-
import java.util.concurrent.Executor;
3028

3129
public final class KQueueSocketChannel extends AbstractKQueueStreamChannel implements SocketChannel {
3230
private final KQueueSocketChannelConfig config;
@@ -99,34 +97,4 @@ protected boolean doConnect0(SocketAddress remoteAddress, SocketAddress localAdd
9997
}
10098
return super.doConnect0(remoteAddress, localAddress);
10199
}
102-
103-
@Override
104-
protected AbstractKQueueUnsafe newUnsafe() {
105-
return new KQueueSocketChannelUnsafe();
106-
}
107-
108-
private final class KQueueSocketChannelUnsafe extends KQueueStreamUnsafe {
109-
@Override
110-
protected Executor prepareToClose() {
111-
try {
112-
// Check isOpen() first as otherwise it will throw a RuntimeException
113-
// when call getSoLinger() as the fd is not valid anymore.
114-
if (isOpen() && config().getSoLinger() > 0) {
115-
// We need to cancel this key of the channel so we may not end up in a eventloop spin
116-
// because we try to read or write until the actual close happens which may be later due
117-
// SO_LINGER handling.
118-
// See https://github.com/netty/netty/issues/4449
119-
if (registration != null) {
120-
registration.remove();
121-
}
122-
return GlobalEventExecutor.INSTANCE;
123-
}
124-
} catch (Throwable ignore) {
125-
// Ignore the error as the underlying channel may be closed in the meantime and so
126-
// getSoLinger() may produce an exception. In this case we just return null.
127-
// See https://github.com/netty/netty/issues/4449
128-
}
129-
return null;
130-
}
131-
}
132100
}

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.