Skip to content

Conversation

@groldan
Copy link
Member

@groldan groldan commented Oct 14, 2025

When adding or modifying a blob store, if an exception occurs after the configuration has been persisted to disk, the stored XML file could be left in an invalid state that prevents application startup on restart.

This prevents GeoServer to store invalid blob store configurations, for as long as the BlobStore throws UnsuitableStorageException, in order not to change the current logic.

This fix ensures that if save() or handleAddBlobStore()/handleModifyBlobStore() fail, the persisted configuration is rolled back by re-saving the previous valid state. Makes loadConfiguration() package-private with @VisibleForTesting to allow tests to verify the persisted state matches expectations after rollback.

Copy link
Contributor

@jodygarnett jodygarnett left a comment

Choose a reason for hiding this comment

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

Minor feedback, but it looks okay

@groldan groldan force-pushed the xmlconfig_revert_blobstore_on_failure_to_save branch from 06edaf2 to 5383600 Compare October 14, 2025 17:12
When adding or modifying a blob store, if an exception occurs after the
configuration has been persisted to disk, the stored XML file could be left
in an invalid state that prevents application startup on restart.

This prevents GeoServer to store invalid blob store configurations, for
as long as the BlobStore throws UnsuitableStorageException, in order not
to change the current logic.

This fix ensures that if save() or handleAddBlobStore()/handleModifyBlobStore()
fail, the persisted configuration is rolled back by re-saving the previous
valid state. Makes loadConfiguration() package-private with @VisibleForTesting
to allow tests to verify the persisted state matches expectations after rollback.
@groldan groldan force-pushed the xmlconfig_revert_blobstore_on_failure_to_save branch from 5383600 to 5159d74 Compare October 14, 2025 17:14
@groldan groldan merged commit a65adcd into GeoWebCache:main Oct 14, 2025
11 checks passed
@groldan groldan deleted the xmlconfig_revert_blobstore_on_failure_to_save branch October 14, 2025 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants