-
Notifications
You must be signed in to change notification settings - Fork 557
Do not refresh the snapshot on frozen containers. #25593
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR prevents snapshot refresh on frozen containers by detecting storage-only mode and disabling the refresh mechanism. The change ensures that containers in read-only storage mode do not attempt to refresh snapshots, which is appropriate for frozen containers that should not be modified.
- Adds a
storageOnly
parameter toSerializedStateManager
to disable snapshot refresh timers and logic - Extracts storage-only state from container's
readOnlyInfo.storageOnly
property - Updates all test instantiations to accommodate the new parameter
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
packages/loader/container-loader/src/container.ts | Extracts storage-only state and passes it to SerializedStateManager |
packages/loader/container-loader/src/serializedStateManager.ts | Adds storageOnly parameter and conditional logic to disable refresh functionality |
packages/loader/container-loader/src/test/serializedStateManager.spec.ts | Updates test constructor calls and adds new test for storage-only behavior |
packages/loader/container-loader/src/test/serializedStateManager.spec.ts
Show resolved
Hide resolved
this.storageAdapter, | ||
offlineLoadEnabled, | ||
this, | ||
() => this.isStorageOnly, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's just inline the function here, rather than add single use private getter to the class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, rather than defaulting to false, we probably want to use undefined, as from undefined it could become true or false, but once it's true or false, it should never change
return this._dirtyContainer; | ||
} | ||
|
||
private get isStorageOnly(): boolean { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be deleted
Avoiding refreshing the snapshot on frozen containers by looking at
readOnlyInfo.storageOnly
, disabling the timer that triggers refresh and simply not going throughtryRefreshSnapshot
when in storage only.There is still some work to be done in regards to what should we do when out of storage only mode. Given that is not a priority for version history, we can limit the ability to refresh snapshot at all if we boot from storage only mode and think on how to reactivate the refresh in a follow up.