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

Vert.x: fix NPE in ForwardedProxyHandler #36682

Merged
merged 1 commit into from
Oct 25, 2023

Conversation

Ladicek
Copy link
Contributor

@Ladicek Ladicek commented Oct 25, 2023

The test TrustedXForwarderProxiesUnknownHostnameFailureTest sometimes fail in CI due to a NPE in ForwardedProxyHandler. This shows an actual bug: per the documentation, io.vertx.core.dns.DnsClient.lookup() may succeed with a null value when no record was found. The ForwardedProxyHandler ignores the possibility of a null result, which this commit fixes. We deal with a null result just like with a failure, because it's equivalent to a NXDOMAIN error.

Fixes #36656

The test `TrustedXForwarderProxiesUnknownHostnameFailureTest` sometimes fail
in CI due to a NPE in `ForwardedProxyHandler`. This shows an actual bug:
per the documentation, `io.vertx.core.dns.DnsClient.lookup()` may succeed
with a `null` value when no record was found. The `ForwardedProxyHandler`
ignores the possibility of a `null` result, which this commit fixes. We deal
with a `null` result just like with a failure, because it's equivalent
to a NXDOMAIN error.
@Ladicek
Copy link
Contributor Author

Ladicek commented Oct 25, 2023

See #36310 (comment) for motivation.

Copy link
Member

@michalvavrik michalvavrik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@gsmet
Copy link
Member

gsmet commented Oct 25, 2023

@Ladicek woot! Could you adjust the description to mention it fixes #36656 ?

Copy link
Member

@sberyozkin sberyozkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thanks

@Ladicek
Copy link
Contributor Author

Ladicek commented Oct 25, 2023

Huh, I didn't even bother checking if we have a report for this :-) Thanks @gsmet, added to the description.

@gsmet
Copy link
Member

gsmet commented Oct 25, 2023

Yeah, I'm trying to improve the CI situation so fixing tests, disabling some and creating issues. I hope we will get in a better state soon.

@quarkus-bot
Copy link

quarkus-bot bot commented Oct 25, 2023

Failing Jobs - Building 985e78e

Status Name Step Failures Logs Raw logs Build scan
✔️ JVM Tests - JDK 11
JVM Tests - JDK 17 Build ⚠️ Check → Logs Raw logs
✔️ JVM Tests - JDK 21
✔️ Maven Tests - JDK 11
Maven Tests - JDK 11 Windows Build Failures Logs Raw logs

Full information is available in the Build summary check run.

Failures

⚙️ Maven Tests - JDK 11 Windows #

- Failing: integration-tests/maven 

📦 integration-tests/maven

io.quarkus.maven.it.DevMojoIT.testExternalReloadableArtifacts line 1448 - More details - Source on GitHub

org.awaitility.core.ConditionTimeoutException: Condition with lambda expression in io.quarkus.maven.it.DevMojoIT was not fulfilled within 1 minutes.
	at org.awaitility.core.ConditionAwaiter.await(ConditionAwaiter.java:167)
	at org.awaitility.core.CallableCondition.await(CallableCondition.java:78)

io.quarkus.maven.it.DevMojoIT.testExternalReloadableArtifacts line 1448 - More details - Source on GitHub

org.awaitility.core.ConditionTimeoutException: Condition with lambda expression in io.quarkus.maven.it.DevMojoIT was not fulfilled within 1 minutes.
	at org.awaitility.core.ConditionAwaiter.await(ConditionAwaiter.java:167)
	at org.awaitility.core.CallableCondition.await(CallableCondition.java:78)

io.quarkus.maven.it.JarRunnerIT.testNonAsciiDir line 70 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting actual:

io.quarkus.maven.it.JarRunnerIT.testNonAsciiDir line 70 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting actual:

io.quarkus.maven.it.JarRunnerIT.testPlatformPropertiesOverridenInApplicationProperties line 135 - More details - Source on GitHub

org.awaitility.core.ConditionTimeoutException: Condition with lambda expression in io.quarkus.maven.it.JarRunnerIT that uses io.quarkus.maven.it.verifier.MavenProcessInvocationResult was not fulfilled within 1 minutes.
	at org.awaitility.core.ConditionAwaiter.await(ConditionAwaiter.java:167)
	at org.awaitility.core.CallableCondition.await(CallableCondition.java:78)

io.quarkus.maven.it.JarRunnerIT.testPlatformPropertiesOverridenInApplicationProperties line 135 - More details - Source on GitHub

org.awaitility.core.ConditionTimeoutException: Condition with lambda expression in io.quarkus.maven.it.JarRunnerIT that uses io.quarkus.maven.it.verifier.MavenProcessInvocationResult was not fulfilled within 1 minutes.
	at org.awaitility.core.ConditionAwaiter.await(ConditionAwaiter.java:167)
	at org.awaitility.core.CallableCondition.await(CallableCondition.java:78)

@gsmet gsmet merged commit 8cb1e33 into quarkusio:main Oct 25, 2023
49 of 51 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.6 - main milestone Oct 25, 2023
@aloubyansky aloubyansky modified the milestones: 3.6 - main, 3.2.8.Final Oct 26, 2023
@Ladicek Ladicek deleted the forwarded-proxy-handler-npe branch October 26, 2023 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TrustedXForwarderProxiesUnknownHostnameFailureTest failing on Windows
6 participants