Skip to content

Fix FastNodeProvisionerStrategy untracked cloudstats#1207

Open
datGryphon wants to merge 1 commit into
jenkinsci:masterfrom
data-ductus:cwastler/fix-untracked-cloudstats
Open

Fix FastNodeProvisionerStrategy untracked cloudstats#1207
datGryphon wants to merge 1 commit into
jenkinsci:masterfrom
data-ductus:cwastler/fix-untracked-cloudstats

Conversation

@datGryphon

Copy link
Copy Markdown

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 #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

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests that demonstrate the feature works or the issue is fixed

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
@datGryphon datGryphon requested a review from a team as a code owner June 15, 2026 22:32
@MarkEWaite MarkEWaite added the bug An issue reporting a bug or a PR fixing one. label Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug An issue reporting a bug or a PR fixing one.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cloud Statistics cannot track Nodes provisioned by FastNodeProvisionerStrategy

2 participants