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

Stork custom serviceDiscovery default Host is not working anymore #27870

Closed
pjgg opened this issue Sep 12, 2022 · 4 comments · Fixed by #27891
Closed

Stork custom serviceDiscovery default Host is not working anymore #27870

pjgg opened this issue Sep 12, 2022 · 4 comments · Fixed by #27891
Assignees
Labels
area/stork kind/bug Something isn't working
Milestone

Comments

@pjgg
Copy link
Contributor

pjgg commented Sep 12, 2022

Describe the bug

Quarkus version: Upstream
Extension: stork-core and stork-configuration-generator

If no quarkus.stork.<SERVICE_NAME>.service-discovery.host is provided then by default localhost/127.0.0.1:80 is used as a service discovery host, and then an exception is thrown

2022-09-12 13:55:41,835 ERROR [io.qua.mut.run.MutinyInfrastructure] (vert.x-eventloop-thread-1) Mutiny had to drop the following exception: javax.ws.rs.WebApplicationException: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: localhost/127.0.0.1:80
	at io.quarkus.ts.stork.custom.PingResource.lambda$pong$0(PingResource.java:22)
	at io.smallrye.context.impl.wrappers.SlowContextualFunction.apply(SlowContextualFunction.java:21)
	at io.smallrye.mutiny.operators.uni.UniOnFailureTransform$UniOnFailureTransformProcessor.onFailure(UniOnFailureTransform.java:54)
	at io.smallrye.mutiny.operators.uni.builders.UniCreateFromCompletionStage$CompletionStageUniSubscription.forwardResult(UniCreateFromCompletionStage.java:58)
	at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:863)
	at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:841)

In previous upstream version, the default host was localhost.

Work around: Define on your application.properties the required Host with the expected format

Expected behavior

Default stork service discovery host should be localhost

Actual behavior

Default stork service is set to localhost/127.0.0.1:80

How to Reproduce?

git clone git@github.com:quarkus-qe/quarkus-test-suite.git

Go to the following module https://github.com/quarkus-qe/quarkus-test-suite/tree/main/service-discovery/stork-custom and set this application.properties

#quarkus.stork.pong.load-balancer.type=simplelb
quarkus.stork.pong.service-discovery.type=simple
# this properties make sense if you have a global service discovery state as a DB, for this scenario we are going to use an in-memory Map
#quarkus.stork.pong.service-discovery.host=localhost
quarkus.stork.pong.service-discovery.port=8080
#quarkus.stork.pong.service-discovery.pongServiceHost=localhost
quarkus.stork.pong.service-discovery.pongServicePort=8080

#quarkus.stork.pong-replica.load-balancer.type=simplelb
quarkus.stork.pong-replica.service-discovery.type=simple
# this properties make sense if you have a global service discovery state as a DB, for this scenario we are going to use an in-memory Map
#quarkus.stork.pong-replica.service-discovery.host=localhost
quarkus.stork.pong-replica.service-discovery.port=8080
#quarkus.stork.pong-replica.service-discovery.pongReplicaServiceHost=localhost
quarkus.stork.pong-replica.service-discovery.pongReplicaServicePort=8080

Then start the app in dev mode: mvn quarkus:dev

and finally run: curl -v Http://localhost:8080/ping/pong

Note: service discovery hostproperties are commented

@pjgg pjgg added the kind/bug Something isn't working label Sep 12, 2022
@quarkus-bot
Copy link

quarkus-bot bot commented Sep 12, 2022

/cc @Sgitario, @aureamunoz, @cescoffier

@rsvoboda
Copy link
Member

Sounds there is a change in behaviour / possible regression in stork.

Should we have entry in https://github.com/quarkusio/quarkus/wiki/Migration-Guide-2.13 about that? @aureamunoz

@cescoffier cescoffier self-assigned this Sep 13, 2022
@cescoffier
Copy link
Member

The problem is that the service discovery provider does not provide the host and port for the service instance.
So we can argue it's a bug in the service discovery provider.

However, as it seems that it was supported before, I'm opening a PR handling the null host and 0 port

@aureamunoz
Copy link
Member

The problem is that the service discovery provider does not provide the host and port for the service instance. So we can argue it's a bug in the service discovery provider.

However, as it seems that it was supported before, I'm opening a PR handling the null host and 0 port

Yes, its kind of regression. I was just checking what the ClientSendRequestHandlerdid before but you were faster ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/stork kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants