-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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 config leaks between instances in a continuous testing run #47178
Comments
/cc @aureamunoz (stork), @cescoffier (stork), @geoand (continuous-testing), @radcortez (config) |
Stork uses a static field for the singleton. We would need to check if the instance is re-initialized correctly. |
Following @cescoffier's tip, I looked at
on initialisation, it adds to that list, without clearing it first, so the old and new config are both present after a continuous testing restart. That seems bad, but ... fixing that with |
I think we also keep the Stork instance: https://github.com/smallrye/smallrye-stork/blob/main/core/src/main/java/io/smallrye/stork/Stork.java#L264 |
I tried |
Do you have a reproducer? I can have a look this weekend. |
I've pushed https://github.com/holly-cummins/quarkus-super-heroes/tree/47178-reproducer which saves doing the edits in the instructions above. It should be sufficient to run If you want to reproduce with
and rebuild quarkus to include #47180. |
Will try with the one mentioned in the description |
Hum, I wanted to look, but it downloaded too many images from Docker Hub, so I hit the quota (even if I'm logged in). I will need to give it another attempt in a few hours. |
Ok, I've a fix. Unfortunately, it requires a fix in Stork and one in Quarkus (Stork extension). Ths first part is, and I believe @holly-cummins found it, a problem in the Quarkus StorkConfigProvider - the list is not cleared during the initialization of the method:
The second one is in Stork itself. For performance reason, Stork "static" service discovery (which is not limited to the stack-service-discovery, but any type of service discovery with a known set of service instances) also uses a static list that was not cleared.
Openeing PRs right now. |
Stork pull request: smallrye/smallrye-stork#1023 |
Thanks! |
Describe the bug
This reproduces with 3.20.0, so it's not caused by the test classloading rewrite. :)
It also reproduces on main, and #47180 exposes it for the
mvn verify
case, which is of course worse.Steps to reproduce
check out superheroes
cd rest-fights
Edit
HeroesVillainsNarrationWiremockServerResource
and delete thequarkus.stork.hero-service.service-discovery.address-list
config override, so that the application is always reading config fromapplication.properties
. I don't think this step is strictly necessary, but it makes reproducing and searching easier, because the 'wrong' port is a predictable one.Now if you run
quarkus test
you'll get 4-12 failures. on 3.21.0 you will see 8 pre-existing failures, caused by Continous testing fails for superheroesrest-fights
#47177, main will be a bit less red. But in either case there will be extra, expected, failures caused by the fact that you're trying to connect to an endpoint you haven't mocked. You can search the logs for8083
for those.Then edit
application.properties
and change 8083 to 1234. If you look at the logs, you'll get messages saying "I can't connect to port 1234" (expected), but some of the messages will still reference port 8083. Nothing should know about 8083, but something does.To get a smaller reproducer, you can delete everything except
HeroClientTest
.Stack traces
Why do I think stork is involved?
If you stop the application and change
to
and then run
quarkus test
, you get expected failures references 4321. If you then change 4321 to 8888 inapplication.properties
and save, there are no more references to 4321 in the new logging.The text was updated successfully, but these errors were encountered: