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

Check reachability of sub resources before indexing them #46464

Merged

Conversation

Postremus
Copy link
Member

This makes sure, that the absent and present sub resources can actually be reached from a root resource class in the server endpoint indexer. Otherwise, e.g. client sub resource interface could get indexed as server endpoints.

I measured following times during hot reload.
With 2df8c69:

576ms
543ms
536ms
500ms
500ms
491ms
avg 524,3333333ms

2df8c69 + this patch

457ms
431ms
401ms
403ms
405ms
393ms
avg 415ms

improves hot reload times by about 80ms
related to #45631
replaces #46325

This makes sure, that the absent and present sub resources can actually be reached from a root resource class in the server endpoint indexer. Otherwise, e.g. client sub resource interface could get indexed as server endpoints
@Postremus Postremus marked this pull request as ready for review February 24, 2025 19:17
@Postremus Postremus requested review from geoand and gsmet February 24, 2025 19:17
Copy link

quarkus-bot bot commented Feb 24, 2025

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit a8e59e1.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.


Flaky tests - Develocity

⚙️ JVM Integration Tests - JDK 17

📦 integration-tests/grpc-hibernate

com.example.grpc.hibernate.BlockingRawTest.shouldAdd - History

  • Condition with Lambda expression in com.example.grpc.hibernate.BlockingRawTestBase was not fulfilled within 30 seconds. - org.awaitility.core.ConditionTimeoutException
org.awaitility.core.ConditionTimeoutException: Condition with Lambda expression in com.example.grpc.hibernate.BlockingRawTestBase was not fulfilled within 30 seconds.
	at org.awaitility.core.ConditionAwaiter.await(ConditionAwaiter.java:167)
	at org.awaitility.core.CallableCondition.await(CallableCondition.java:78)
	at org.awaitility.core.CallableCondition.await(CallableCondition.java:26)
	at org.awaitility.core.ConditionFactory.until(ConditionFactory.java:1006)
	at org.awaitility.core.ConditionFactory.until(ConditionFactory.java:975)
	at com.example.grpc.hibernate.BlockingRawTestBase.shouldAdd(BlockingRawTestBase.java:59)
	at java.base/java.lang.reflect.Method.invoke(Method.java:569)

⚙️ JVM Integration Tests - JDK 21

📦 integration-tests/virtual-threads/mailer-virtual-threads

io.quarkus.virtual.mail.RunOnVirtualThreadTest.test - History

  • Read timed out - java.net.SocketTimeoutException
java.net.SocketTimeoutException: Read timed out
	at java.base/sun.nio.ch.NioSocketImpl.timedRead(NioSocketImpl.java:278)
	at java.base/sun.nio.ch.NioSocketImpl.implRead(NioSocketImpl.java:304)
	at java.base/sun.nio.ch.NioSocketImpl.read(NioSocketImpl.java:346)
	at java.base/sun.nio.ch.NioSocketImpl$1.read(NioSocketImpl.java:796)
	at java.base/java.net.Socket$SocketInputStream.read(Socket.java:1099)
	at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:161)
	at org.apache.http.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:82)

}

public interface UndangerousGoodsResource {
// not even dangerous enough to get a resource method
Copy link
Contributor

Choose a reason for hiding this comment

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

😆

Copy link
Contributor

@geoand geoand left a comment

Choose a reason for hiding this comment

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

Great work!

return typeName;
} else if (type.kind() == Type.Kind.PARAMETERIZED_TYPE
&& typeName.equals(DotName.createSimple(Class.class))) {
// spec allows for Class<SubResource> to be returned that the container should instantiate
Copy link
Contributor

Choose a reason for hiding this comment

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

I didn't know that and don't think I've ever seen it used :)

Copy link
Member Author

Choose a reason for hiding this comment

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

I was surprised, to say the least :)

@geoand geoand merged commit f4a362a into quarkusio:main Feb 25, 2025
57 of 69 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.21 - main milestone Feb 25, 2025
@gsmet
Copy link
Member

gsmet commented Feb 25, 2025

Thanks for following up on this!

gsmet added a commit to gsmet/quarkus that referenced this pull request Feb 26, 2025
This is a follow-up of quarkusio#46464.

Given the purpose of the PR was to improve dev mode reload performance,
I think it's worth avoid the extra allocations.
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.

3 participants