smallrye-health icon indicating copy to clipboard operation
smallrye-health copied to clipboard

Remove health checks Uni caching

Open xstefank opened this issue 8 months ago • 2 comments

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.

xstefank avatar Apr 02 '25 13:04 xstefank

@jponge can you have a look?

cescoffier avatar Apr 02 '25 17:04 cescoffier

I've had a private discussion with @xstefank / I'm not sure I get it all but I'll have another look.

jponge avatar Apr 02 '25 19:04 jponge

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

xstefank avatar Apr 09 '25 09:04 xstefank

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.

jponge avatar Apr 09 '25 09:04 jponge

Get rid of it, yes please! :-)

Ladicek avatar Apr 09 '25 09:04 Ladicek

My conclusion is that caching here isn't terribly helpful anyway 😄

jponge avatar Apr 09 '25 15:04 jponge

Thanks @jponge so we are going forward with this :)

Time to pop some champagne, @Ladicek :D

xstefank avatar Apr 10 '25 05:04 xstefank