Skip to content
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

Merge 4.2.x into 4.3.x #10329

Merged
merged 42 commits into from
Jan 5, 2024
Merged

Merge 4.2.x into 4.3.x #10329

merged 42 commits into from
Jan 5, 2024

Conversation

sdelamo
Copy link
Collaborator

@sdelamo sdelamo commented Jan 5, 2024

No description provided.

renovate bot and others added 30 commits December 3, 2023 12:18
#10191)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…-http3 to v0.0.23.final (#10222)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* Update ROADMAP.adoc

Close #10205

* Update ROADMAP.adoc
…solver-core to v3.25.7 (#10207)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* Allow context-path to be an empty String

* Update ConfigurableUriNamingStrategySpec
* docs: add reactor context propagation example

closes #10219

* fix test failures

* add clarification about modified propagation context

* improve example

* fix code smell

* refactor to fix code smell

* change example to use custom context element

* refine example

* include example imports
* Update breaks.adoc

update to include breaking library changes

* Update breaks.adoc
….1.2 (#10249)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…om to v2.2.0 (#10241)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…om to v3.2.0 (#10234)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
It was seen in the Aws module that `@MockLambdaTest` and `@MockBean` did not work as expected.

micronaut-projects/micronaut-aws#1870

This is because:

1. `@MockBean` uses the Refreshable scope
2. `@MockLambdaTest` adds Environment.FUNCTION to the test context
3. The Refresh scope is disabled for the FUNCTION environment

After this PR, RefreshScope is still disabled for Environment.FUNCTION...

...*UNLESS* Environment.TEST is also enabled.
…d auto scenarios (#10104)

* change comment copy

* test. ThreadSelection accept event loop in the handler in blocking and auto scenarios

The test is really flaky:

https://ge.micronaut.io/scans/tests?search.timeZoneId=Europe%2FMadrid&tests.container=io.micronaut.http.server.netty.threading.ThreadSelectionSpec

* disable test

---------

Co-authored-by: yawkat <jonas.konrad@oracle.com>
…10149)

* Reproducer

* Add Kotlin reproducer as well

* Unbox primitive

---------

Co-authored-by: Denis Stepanov <denis.s.stepanov@oracle.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* Fix logged errors reported by fuzzing
There are two bugs fixed here:

(1) Empty URI handling in HateoasErrorResponseProcessor

```
10:18:18.775 [main] ERROR i.m.h.s.netty.RoutingInBoundHandler - Micronaut Server Error - No request state present. Cause: URI cannot be empty
java.lang.IllegalArgumentException: URI cannot be empty
	at io.micronaut.http.hateoas.DefaultLink.<init>(DefaultLink.java:49)
	at io.micronaut.http.hateoas.Link.of(Link.java:115)
	at io.micronaut.http.server.exceptions.response.HateoasErrorResponseProcessor.processResponse(HateoasErrorResponseProcessor.java:69)
	at io.micronaut.http.server.RouteExecutor.createDefaultErrorResponse(RouteExecutor.java:214)
	at io.micronaut.http.server.netty.RoutingInBoundHandler.writeResponse(RoutingInBoundHandler.java:229)
	at io.micronaut.http.server.netty.NettyRequestLifecycle.lambda$handleException$2(NettyRequestLifecycle.java:147)
	at io.micronaut.core.execution.ImperativeExecutionFlowImpl.onComplete(ImperativeExecutionFlowImpl.java:132)
	at io.micronaut.http.server.netty.NettyRequestLifecycle.handleException(NettyRequestLifecycle.java:147)
	at io.micronaut.http.server.netty.NettyRequestLifecycle.handleNormal(NettyRequestLifecycle.java:89)
	at io.micronaut.http.server.netty.RoutingInBoundHandler.accept(RoutingInBoundHandler.java:220)
[...]
```

Test input added to FuzzyInputSpec. FuzzyInputSpec has been adjusted to recognize logged errors.

(2) Bad sorting in MediaType.orderedOf

```
11:48:58.716 [41560@yawkat-oracle main] ERROR i.m.http.server.RouteExecutor - Unexpected error occurred: Comparison method violates its general contract!
java.lang.IllegalArgumentException: Comparison method violates its general contract!
	at java.base/java.util.TimSort.mergeLo(TimSort.java:781)
	at java.base/java.util.TimSort.mergeAt(TimSort.java:518)
	at java.base/java.util.TimSort.mergeForceCollapse(TimSort.java:461)
	at java.base/java.util.TimSort.sort(TimSort.java:254)
	at java.base/java.util.Arrays.sort(Arrays.java:1307)
	at java.base/java.util.ArrayList.sort(ArrayList.java:1721)
	at io.micronaut.http.MediaType.orderedOf(MediaType.java:870)
	at io.micronaut.http.netty.NettyHttpHeaders.accept(NettyHttpHeaders.java:301)
```

Created a new MediaTypeFuzzTest that hits this issue. The sample input (crash-22df7f6e72bba86bdb1fdbd4bf92372fd4fa6bbe) reproduces the issue and will be run as part of the normal micronaut-http test suite now. Setting the env variable JAZZER_FUZZ=1 will enable exploratory fuzzing.

(3) Added workaround for netty/netty#13730

This does not appear to be an issue in the real world, only with EmbeddedChannel. I've added a workaround for the issue so that it doesn't trigger my fuzz tests anymore.

---

None of these bugs appear security-relevant, (3) is not applicable outside a test env, (1) and (2) only produce additional error logs.

* annotation
dstepanov and others added 11 commits December 18, 2023 16:26
…0283)

A class loading deadlock can occur when ConversionContext is initialised concurrently since it has static final fields that are sub interfaces which are also initialised causing a loop.

This doesn't manifest on JIT likely because these classes are never initialised concurrently, but a deadlock can occur in the Graal compiler.

A real fix would to be alter the code but unfortunately there is no way to do this in a backwards compatible way.

A workaround in Graal is to explicitly initialise these classes at build time which happens very early, avoiding the concurrent access that causes the deadlock.
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
FullOutboundHandler needs to call responseWritten on discard, otherwise RoutingInboundHandler won't clean up request body. This can happen if the channel is closed while it's not writable, so there's a response backlog.
* Publish service ready / stopped in consistent order

* Update test-suite/src/test/groovy/io/micronaut/EventListenerSpec.groovy

Co-authored-by: Sergio del Amo <sergio.delamo@softamo.com>

* Update test-suite/src/test/groovy/io/micronaut/EventListenerSpec.groovy

Co-authored-by: Sergio del Amo <sergio.delamo@softamo.com>

---------

Co-authored-by: Sergio del Amo <sergio.delamo@softamo.com>
@sdelamo
Copy link
Collaborator Author

sdelamo commented Jan 5, 2024

@yawkat I am trying to merge 4.2.x into 4.3.x. However, io.micronaut.http.server.netty.stream.StreamPressureSpec, introduced in #10138 fails. Is this something you could investigate?

@sdelamo sdelamo added this to the 4.3.0 milestone Jan 5, 2024
@yawkat
Copy link
Member

yawkat commented Jan 5, 2024

it passes for me

@sdelamo sdelamo marked this pull request as ready for review January 5, 2024 12:07
@sdelamo
Copy link
Collaborator Author

sdelamo commented Jan 5, 2024

It fails for me consistently MacOS Sonoma. OpenJDK Runtime Environment Corretto-17.0.8.7.1 (build 17.0.8+7-LTS)

https://ge.micronaut.io/s/dpdmnicl7tdcg

Can it be failing only on MacOS? @graemerocher @timyates could either or you the following test passes or fails locally:

./gradlew :http-server-netty:test --tests io.micronaut.http.server.netty.stream.StreamPressureSpec

@timyates
Copy link
Member

timyates commented Jan 5, 2024

@sdelamo
Copy link
Collaborator Author

sdelamo commented Jan 5, 2024

I ignored it on MacOS

Copy link

sonarcloud bot commented Jan 5, 2024

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

3 New issues
0 Security Hotspots
92.1% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

@sdelamo sdelamo merged commit 15119ba into 4.3.x Jan 5, 2024
15 checks passed
@sdelamo sdelamo deleted the stream-pressure-spec branch January 5, 2024 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

10 participants