Open rshmhrj opened 2 months ago
Hi, we don't consider this a bug. Better support for hot reload is a feature request and we don't currently have capacity to do this. We do have capacity to look at a PR though if you'd like to have a stab at fixing it yourself.
Describe the bug
This config works fine normally, but when we are working on a dev laptop, with devtools running, saving changes within the codebase causes a hot reload. The
UnleashClientConfig
reloads and there is still anunleash
bean running in theApplicationContext
. TheConditionalOnMissingBean
doesn't trigger on Hot Reload, sonew DefaultUnleash(unleashConfig)
runs and spits out some errors:Every time we save, it throws the errors.
I tried fixing by checking to see if the bean was already running and kept facing circular dependency errors. Tried with the normal singleton pattern,
@Scope("singleton")
, trying to find the bean from theApplicationContext
and they all kept failing for circular dependencies.With the below code change, the server starts, but as soon as I hit an endpoint and the bean is initialized, it fails with
BeanCreationException
:Steps to reproduce the bug
No response
Expected behavior
I saw in the docs that there is a
shutdown()
method which could probably be used, but I'm not sure where or how to set that up. Is there any known way of dealing with the bean recreation during hot reloading?Logs, error output, etc.
No response
Screenshots
No response
Additional context
No response
Unleash version
5.9.6
Subscription type
Open source
Hosting type
Self-hosted
SDK information (language and version)
Java