Fix FastNodeProvisionerStrategy untracked cloudstats#1207
Open
datGryphon wants to merge 1 commit into
Open
Conversation
FastNodeProvisionerStrategy was not calling CloudProvisioningListener.onStarted so Nodes provisioned by it could not be tracked. Without this call, the ProvisioningActivity object is not created from the TrackedPlannedNode id. Without the ProvisioningActivity, the cloudstats plugin is not able to accurately track the lifecycle of the node. This fix calls onStarted the same way it is done by hudson.slaves.NodeProvisioner#fireOnStarted. Fixes cloudstats ability to track nodes provisioned by FastNodeProvisionerStrategy and removes `IllegalStateException` tracebacks for: cloudstats.CloudStatistics#getActivityFor: No activity tracked for ... Fixes jenkinsci#1206
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
FastNodeProvisionerStrategywas not callingCloudProvisioningListener#onStartedso Nodes provisioned by it could not be tracked. Without this call, theProvisioningActivityobject is not created from theTrackedPlannedNodeid. Without theProvisioningActivity, the cloudstats plugin is not able to accurately track the lifecycle of the node.This fix calls onStarted the same way it is done by
hudson.slaves.NodeProvisioner#fireOnStarted. Fixes cloudstats ability to track nodes provisioned byFastNodeProvisionerStrategyand removesIllegalStateExceptiontracebacks for:cloudstats.CloudStatistics#getActivityFor: No activity tracked for ...Fixes #1206
This patch addresses the issue by following the same pattern that NodeProvisioner uses: fireOnStarted. It is a private method so I've inlined it into the strategy.
Testing done
This change was tested against the reproduction script sited in #1206. The expected behavior in that issue description was produced using this code. There is also a unit test included to exercise the relevant lines.
Submitter checklist