Skip to content
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

Refresh Scope on restart. #1266

Merged
merged 6 commits into from Sep 21, 2023
Merged

Refresh Scope on restart. #1266

merged 6 commits into from Sep 21, 2023

Conversation

OlgaMaciaszek
Copy link
Collaborator

No description provided.

@OlgaMaciaszek OlgaMaciaszek added this to the 4.1.0-M2 milestone Sep 20, 2023
@OlgaMaciaszek OlgaMaciaszek self-assigned this Sep 20, 2023
@OlgaMaciaszek OlgaMaciaszek added this to In progress in 2022.0.x via automation Sep 20, 2023
@OlgaMaciaszek OlgaMaciaszek marked this pull request as draft September 20, 2023 10:01
@OlgaMaciaszek OlgaMaciaszek removed this from In progress in 2022.0.x Sep 20, 2023
synchronized (lifecycleMonitor) {
if (!isRunning()) {
if (LOG.isDebugEnabled()) {
LOG.debug("Refreshing context on restart.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say this is important enough for info rather than debug

@OlgaMaciaszek OlgaMaciaszek marked this pull request as ready for review September 20, 2023 15:26
@OlgaMaciaszek
Copy link
Collaborator Author

@Buzzardo could you please take a look at the doc changes?

@OlgaMaciaszek OlgaMaciaszek merged commit 9449edf into main Sep 21, 2023
3 checks passed
[refresh-scope-on-restart]
=== Refresh Scope on Restart

In order to allow seamlessly refreshing beans on restart, which is especially useful for applications running with JVM Checkpoint Restore (for example with https://github.com/CRaC[Project CRaC]), we now instantiate a `RefreshScopeLifecycle` bean that will trigger Context Refresh on restart, resulting in rebinding configuration properties and refreshing any `@RefreshScope`-annotated beans. This behaviour can be disabled by setting the value of `spring.cloud.refresh.on-restart.enabled` to `false`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That long and complex sentence is hard to parse in one pass, so please change it to:

Seamlessly refreshing beans on restart is especially useful for applications that run with JVM Checkpoint Restore (such as https://github.com/CRaC[Project CRaC]). To allow this ability, we now instantiate a RefreshScopeLifecycle bean that triggers Context Refresh on restart, resulting in rebinding configuration properties and refreshing any beans annotated with @RefreshScope. You can disable this behavior by setting spring.cloud.refresh.on-restart.enabled to false.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Buzzardo - will change.

@OlgaMaciaszek OlgaMaciaszek deleted the refresh-scope-on-restart branch November 13, 2023 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Status: In Progress
Development

Successfully merging this pull request may close these issues.

None yet

3 participants