RefreshScode refresh mechanism is not safe

Abierto
#1,478 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
25/100
Tipo de issue
Nueva funcionalidad
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
java, spring, spring-boot
Área
backend, cloud

Línea de trabajo

Comienza rastreando el ciclo de vida de @RefreshScope en el proyecto spring-cloud, centrándote en cómo se aplican las propiedades del entorno y en cómo se destruye y se vuelve a crear el bean actual. Compara ese comportamiento con el reemplazo temporal de beans solicitado y considera la solicitud separada de mover @RefreshScope a Spring Boot. Se consideraría completado cuando haya un diseño acordado y se haya verificado un comportamiento seguro de actualización en tiempo de ejecución.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

waiting-for-triage

Is your feature request related to a problem? Please describe.

@RefreshScope may not be secure enough as it will first destroy the current bean and then create a new bean. What if the environment properties encounter an exception when creating a new bean? This online running application will be a disaster.

Describe the solution you'd like

Is it possible to adjust the order and first try creating a temporary bean? If it can be initialized normally, then replace the original bean. This will be a significant optimization for runtime configuration updates.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context

In addition,if it is possible to move @RefreshScope from spring-cloud to spring boot? it should not be bundled to spring cloud project.

I am a core builder in the Nacos community (https://nacos.io/en/) which is widely used by chinese developer community and I am responsible for config center.
We want to implement all configurations on the hosted application side, support elegant updates during runtime, and improve the efficiency of business software iteration. If Spring can support elegant refresh beans, then there is no need for every second party middleware to implement this feature

Lenguaje dominante
Java
Estrellas
751
Forks
767
Merge medio
1 d 1 h
PR fusionados (30 d)
17

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de spring-cloud/spring-cloud-commons

Todos los issues de spring-cloud/spring-cloud-commons

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.