Skip to content

Build stability fix + .gitignore update - #1

Merged
2 commits merged into
netty:3.2from
trustin:3.2
Nov 15, 2010
Merged

2 commits merged into
netty:3.2from
trustin:3.2

Conversation

@trustin

@trustin trustin commented Nov 15, 2010

Copy link
Copy Markdown
Member

No description provided.

@adilavismg adilavismg mentioned this pull request Jun 6, 2013
normanmaurer added a commit that referenced this pull request Nov 18, 2024
#14475)

…4472)

Motivation:

Corretto does not use "likes" and so we need to ensure we compute it
without these.

Modifications:

Manually compose the classifier to use

Result:

Always use the correct classifier no matter on which linux system we
compile
@lasse42 lasse42 mentioned this pull request Nov 25, 2024
normanmaurer added a commit that referenced this pull request Feb 18, 2025
#14833)

…4830)

Motivation:

We need to check if pendingUnencryptedWrites is null before accessing it
as the SslHandler might have been removed in the meantime.

```
io.netty.handler.codec.DecoderException: java.lang.NullPointerException: Cannot invoke "io.netty.handler.ssl.SslHandlerCoalescingBufferQueue.isEmpty()" because "this.pendingUnencryptedWrites" is null
	at io.netty.handler.ssl.SslHandler$SslTasksRunner.wrapIfNeeded(SslHandler.java:1798)
	at io.netty.handler.ssl.SslHandler$SslTasksRunner.safeExceptionCaught(SslHandler.java:1785)
	at io.netty.handler.ssl.SslHandler$SslTasksRunner.resumeOnEventExecutor(SslHandler.java:1896)
	at io.netty.handler.ssl.SslHandler$SslTasksRunner.access$2000(SslHandler.java:1751)
	at io.netty.handler.ssl.SslHandler$SslTasksRunner$2.run(SslHandler.java:1912)
	at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:173)
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:166)
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
	at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:405)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:998)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.NullPointerException: Cannot invoke "io.netty.handler.ssl.SslHandlerCoalescingBufferQueue.isEmpty()" because "this.pendingUnencryptedWrites" is null
	at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1503)
	at io.netty.handler.ssl.SslHandler.unwrapNonAppData(SslHandler.java:1469)
	at io.netty.handler.ssl.SslHandler.access$1800(SslHandler.java:170)
	at io.netty.handler.ssl.SslHandler$SslTasksRunner.resumeOnEventExecutor(SslHandler.java:1847)
	... 9 more
```

Modifications:

Add null check

Result:

Fix NPE
normanmaurer added a commit that referenced this pull request Feb 28, 2025
#14870)

…4799)

…#encodeNextChunkUrlEncoded(int) for current InterfaceHttpData

Motivation:

I am using `HttpPostRequestEncoder` to encode a few request parameters,
but I read **infinite** chunks when the following conditions are met:

1. The number of POST request parameters is greater than or equal to 2.
2. The length of the first request parameter value >
`DefaultHttpDataFactory#minSize`.
3. The length of the first request parameter key + the length of the
request parameter value + 2 = N * `HttpPostBodyUtil#chunkSize`

This issue can be reproduced by modifying the

[length](https://github.com/netty/netty/blob/34011b5f02c52122eccd36ce7cc69502a514d0f1/codec-http/src/test/java/io/netty/handler/codec/http/multipart/HttpPostRequestEncoderTest.java#L454)
variable in the

[HttpPostRequestEncoderTest#testEncodeChunkedContent()](https://github.com/netty/netty/blob/34011b5f02c52122eccd36ce7cc69502a514d0f1/codec-http/src/test/java/io/netty/handler/codec/http/multipart/HttpPostRequestEncoderTest.java#L450)
method to `HttpPostBodyUtil.chunkSize * 3 - 4 - 2`. Normally, this test
method should complete quickly, but when the length variable is set to
`HttpPostBodyUtil.chunkSize * 3 - 4 - 2`, it will never finish.

Modification:

1. Enhance the logic of determining whether the current
`InterfaceHttpData` has been fully read.

Result:

Fix flawed termination condition check.

Co-authored-by: LinShunKang <[email protected]>
Co-authored-by: LinShunKang <[email protected]>
normanmaurer added a commit that referenced this pull request May 30, 2025
#15293)

…5279)

Motivation:

In Kqueue it sometimes happened that we did see a WARN that the
registration for a given id could not be found. The reason for this was
that it is possible that the registration was already be cancelled by
the user and so not present anymore. In this case the logs are harmless
but still confusing. We should better ensure we handle it better.

Modifications:

When the user cancels a registration just mark it as cancelled and
remove it from the map one all events are processed.

Result:

Less confusing logging and more correct handling of cancelled
registrations
normanmaurer added a commit that referenced this pull request Jun 24, 2025
#15395)

…5281)

Motivation:

In our testsuite we often just wrapped a byte[] and passed it to the
write method. While this works it also might end up not testing often
with direct buffers. We should make this a bit more random and so cover
direct and heap buffers. The idea popped up when reviewing
#15231

Modifications:

- Add new static helper method that will either return a wrapped buffer
or a direct buffers in a random fashion
- Use this method to allocate buffers

Result:

More random testing of heap / direct buffers
normanmaurer pushed a commit that referenced this pull request Sep 10, 2026
Motivation:

Production allocation profiling identified `SslHandler.wrap()`'s
`ctx.newPromise()` as the source of ~79% of sampled
`DefaultChannelPromise` allocations. `wrap()` allocates the promise
before checking whether `pendingUnencryptedWrites` contains another
entry. After the last entry is consumed, the loop may iterate once more,
allocate a `ChannelPromise`, receive null from remove/removeFirst, and
immediately discard the promise.

<img width="1538" height="110" alt="image"
src="https://github.com/user-attachments/assets/e567e5f5-281e-4fcd-8c64-d5e5a320efcd"
/>

Flow:

```
iteration #1
  newPromise()        // useful
  removeFirst() -> buf
  encrypt buf
  queue now empty

iteration #2
  newPromise()        // wasted allocation
  removeFirst() -> null
  break
```


Modification:

Added a guard check `!pendingUnencryptedWrites.isEmpty()` to avoid
unnecessary loop iteration.

Result:

Less garbage in SslHandler for outgoing packets.

```
import io.netty.buffer.ByteBuf;
import org.openjdk.jmh.annotations.Benchmark;

public class SslHandlerWrapBenchmark extends AbstractSslHandlerThroughputBenchmark {

    @benchmark
    public int wrapOneWrite() throws Exception {
        ByteBuf encrypted = doWrite(1);
        try {
            return encrypted.readableBytes();
        } finally {
            encrypted.release();
        }
    }
}
```

```
baseline: 1411.886 B/op
patched:  1336.061 B/op
delta:      75.825 B/op
```
normanmaurer added a commit that referenced this pull request Sep 10, 2026
Motivation:

Production allocation profiling identified `SslHandler.wrap()`'s
`ctx.newPromise()` as the source of ~79% of sampled
`DefaultChannelPromise` allocations. `wrap()` allocates the promise
before checking whether `pendingUnencryptedWrites` contains another
entry. After the last entry is consumed, the loop may iterate once more,
allocate a `ChannelPromise`, receive null from remove/removeFirst, and
immediately discard the promise.

<img width="1538" height="110" alt="image"

src="https://github.com/user-attachments/assets/e567e5f5-281e-4fcd-8c64-d5e5a320efcd"
/>

Flow:

```
iteration #1
  newPromise()        // useful
  removeFirst() -> buf
  encrypt buf
  queue now empty

iteration #2
  newPromise()        // wasted allocation
  removeFirst() -> null
  break
```

Modification:

Added a guard check `!pendingUnencryptedWrites.isEmpty()` to avoid
unnecessary loop iteration.

Result:

Less garbage in SslHandler for outgoing packets.

```
import io.netty.buffer.ByteBuf;
import org.openjdk.jmh.annotations.Benchmark;

public class SslHandlerWrapBenchmark extends AbstractSslHandlerThroughputBenchmark {

    @benchmark
    public int wrapOneWrite() throws Exception {
        ByteBuf encrypted = doWrite(1);
        try {
            return encrypted.readableBytes();
        } finally {
            encrypted.release();
        }
    }
}
```

```
baseline: 1411.886 B/op
patched:  1336.061 B/op
delta:      75.825 B/op
```

Co-authored-by: Dmytro Dumanskiy <[email protected]>
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant