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

Fix save configuration to avoid resetting build counts #308

Merged
merged 1 commit into from
Nov 12, 2021

Conversation

imuqtadir
Copy link

@imuqtadir imuqtadir commented Nov 11, 2021

Whenever the user modifies any configuration setting, the plugin resets the build counts back to maxTotalBuild. After debugging, I found that we refer to old cloud object for CloudNanny which triggers the plugin to re-add already existing node within Jenkins. This bug probably existed for the longest time however it never affected anything until we add maxTotalBuild feature.

More details: When we run update(), the cloud object (this) continues to refer to old cloud object in it's initial run (probably because it was scheduled during/prior the configuration save process) while EC2FleetNode is already re-assigned with the latest cloud object. This causes us to re-add the node hence resetting the build counts. The update() fixes itself in subsequent run however the re-add process is already done by then. This usually happens when the cloud status interval i set low (~5 seconds). The constructor initialization takes around ~3 seconds which results in update() and initialization to happen around the same time.

@imuqtadir imuqtadir linked an issue Nov 11, 2021 that may be closed by this pull request
@imuqtadir imuqtadir requested a review from haugenj November 11, 2021 19:16
Copy link

@haugenj haugenj left a comment

Choose a reason for hiding this comment

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

👍

@imuqtadir imuqtadir merged commit fe18837 into jenkinsci:master Nov 12, 2021
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.

MaxTotalUses gets reset after configuration change
2 participants