Skip to content

Unbounded memory usage in generating traces from stage data #429

Description

@msbit01

Describe the bug
When creating StageData objects for trace generation, there is no limit on the number of objects created, which can result in unbounded memory consumption.

Label the issue properly.

  • Add severity/ label.
  • Add documentation label if this issue is related to documentation changes.

To Reproduce
Steps to reproduce the behavior:

  1. Create a pipeline that produces thousands of stages.
  2. Run the pipeline.
  3. Check heap usage data, e.g. by hitting the /monitoring endpoint if using the monitoring plugin.
  4. Observe large number of StageData objects.

Expected behavior
The code already throws out stage data when the size of the associated json object exceeds 5000 characters, so we should be short-circuiting StageData creation as well.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment and Versions (please complete the following information):
I'm using Jenkins 6.0.3 and believe the issue was introduced in 6.0.0, in this change #381

Additional context
Add any other context about the problem here.

Metadata

Metadata

Labels

kind/bugBug related issue

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions