Remove health checks Uni caching
If we cannot get this scenario to work - https://github.com/xstefank/quarkus-reproducers/blob/main/cache-uni/src/main/java/io/xstefank/GreetingResource.java. Basically, we cannot cache Unis and run the cached instances on the same Vertx. context as the parent context of the request in Quarkus. This means that out-of-the-box, we cannot support request scoped beans, see https://github.com/quarkusio/quarkus/issues/38878. This is why I want to remove the caching of Unis altogether and default to the state as if the io.smallrye.health.context.propagation=true by default.
I still want to wait for @cescoffier to confirm that this scenario doesn't work before I'll proceed with this.
@jponge can you have a look?
I've had a private discussion with @xstefank / I'm not sure I get it all but I'll have another look.
I did a little perf testing and the difference in caching is there but IMO it's not notable in the context of health:
| default | with context-propagation flag | |
|---|---|---|
| no HC | 140k r/s | 121k r/s |
| 1 HC | 106k r/s | 96k r/s |
With all the issue it's causing and the users that use the flag not complaining, I still think we should remove caching.
Also note that with 2+ HC my load test already throttles so I will work on the performance nevertheless and it would be helpful to have only one way of doing things.
https://docs.google.com/spreadsheets/d/1C50_nB6WoMre1uzguxZ76VyDg0mUZDKRRj5bWepQOB4/edit?usp=sharing
I concur that unless you need to build a big pipeline for each new request, there's no real benefit in caching.
I'm still looking at your reproducer, I will ping if I can get something relevant.
Get rid of it, yes please! :-)
My conclusion is that caching here isn't terribly helpful anyway 😄
Thanks @jponge so we are going forward with this :)
Time to pop some champagne, @Ladicek :D