Skip to content
This repository has been archived by the owner on Nov 11, 2024. It is now read-only.

Load properties prior to writing them out to reduce the race timing window length #384

Merged
merged 1 commit into from
Mar 1, 2023

Conversation

techcobweb
Copy link
Contributor

Signed-off-by: Mike Cobbett 77053+techcobweb@users.noreply.github.com

…indow length

Signed-off-by: Mike Cobbett <77053+techcobweb@users.noreply.github.com>
@galasa-team
Copy link

Build successful

@techcobweb techcobweb requested a review from Jimbo4794 March 1, 2023 09:41
@@ -154,6 +154,14 @@ public synchronized List<String> getNamespaces() {
* @throws FrameworkPropertyFileException
*/
public synchronized void delete(String key) throws FrameworkPropertyFileException {
// Make the current properties as close to the values in the file as
// we can. So when we write they are up-to-date.
if (observer!=null) {
Copy link
Member

Choose a reason for hiding this comment

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

Did you need to null check here? The observer is instantiated by the constructor and will throw an exception if unable to create.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

destroy() sets it to null, and some unit tests try setting properties after the destroy call, so I assumed it was supposed to handle it.

@techcobweb techcobweb merged commit 2592e98 into main Mar 1, 2023
@techcobweb techcobweb deleted the mcobbett-1371-framework-race branch June 6, 2023 08:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants