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

Ensure SplunkJenkinsInstallation.load calculates metadataItemSet #35

Merged
merged 1 commit into from
Oct 28, 2024

Conversation

jglick
Copy link
Member

@jglick jglick commented Sep 29, 2023

A user of CloudBees CI in High Availability mode noticed that after saving SplunkJenkinsInstallation on one replica, another replica failed to reflect the updated value in metadataItemSet. This seems to be because as of b6c8513 this state is transient; it does get calculated in the constructor, but not generally in load, which CloudBees CI would call (see jenkinsci/jenkins#8544) when synchronizing GlobalConfiguration. I am not sure if this issue would affect other users; POST /reload or CLI reload-configuration currently looks like it reloads $JENKINS_HOME/config.xml but not other GlobalConfigurations, which may be a core bug. CC @Vlatombe

@Override
public synchronized final void load() {
super.load();
migrate();
Copy link
Member Author

Choose a reason for hiding this comment

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

Hide whitespace to see a shorter diff.

cfg.load();
Set<MetaDataConfigItem> metadataItemSet = cfg.getMetadataItemSet();
assertThat(metadataItemSet, hasSize(1));
assertThat(metadataItemSet.iterator().next().getValue(), is("value999"));
Copy link
Member Author

Choose a reason for hiding this comment

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

Without main patch, the value is still value000: metaDataConfig has been loaded from disk but

this.metadataItemSet = MetaDataConfigItem.loadProps(this.metaDataConfig);
was not called.

@fengxx fengxx merged commit e9553b2 into jenkinsci:master Oct 28, 2024
12 checks passed
@jglick jglick deleted the SplunkJenkinsInstallation.load branch October 28, 2024 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants