-
Notifications
You must be signed in to change notification settings - Fork 74
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
Prevent StepExecutionIterator
from leaking memory in cases where a single processed execution has a stuck CPS VM thread
#347
Merged
Merged
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ce222c4
Add ignored test for corrupt flow graph with a loop that lead to a me…
dwnusbaum 9b6c0ae
Fix the memory leak by making StepExecutionIteratorImpl return Future…
dwnusbaum b2c93a4
Unignore MemoryAssert test
dwnusbaum 7100611
Remove infinite loop test (it is included in a separate newly filed P…
dwnusbaum 2de670d
Allow the stuck build to be cleaned up promptly at the end of the test
dwnusbaum b15fde4
Only activate TestExtension for blockSynchronously in the relevant te…
dwnusbaum File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
46 changes: 46 additions & 0 deletions
46
...stTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/build.xml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?xml version='1.1' encoding='UTF-8'?> | ||
<flow-build plugin="[email protected]_ec82f"> | ||
<queueId>1</queueId> | ||
<timestamp>1722979974600</timestamp> | ||
<startTime>1722979974615</startTime> | ||
<duration>0</duration> | ||
<charset>UTF-8</charset> | ||
<keepLog>false</keepLog> | ||
<execution class="org.jenkinsci.plugins.workflow.cps.CpsFlowExecution"> | ||
<result>SUCCESS</result> | ||
<script>stage('stage') { sleep 30 }; timeout(time: 10) { sleep 30 }</script> | ||
<loadedScripts class="linked-hash-map"/> | ||
<durabilityHint>MAX_SURVIVABILITY</durabilityHint> | ||
<timings class="map"> | ||
<entry> | ||
<string>flowNode</string> | ||
<long>101709541</long> | ||
</entry> | ||
<entry> | ||
<string>classLoad</string> | ||
<long>124446251</long> | ||
</entry> | ||
<entry> | ||
<string>run</string> | ||
<long>200459289</long> | ||
</entry> | ||
<entry> | ||
<string>parse</string> | ||
<long>166818958</long> | ||
</entry> | ||
<entry> | ||
<string>saveProgram</string> | ||
<long>57936125</long> | ||
</entry> | ||
</timings> | ||
<internalCalls class="sorted-set"/> | ||
<sandbox>true</sandbox> | ||
<iota>5</iota> | ||
<head>1:5</head> | ||
dwnusbaum marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<start>2</start> | ||
<done>false</done> | ||
<resumeBlocked>false</resumeBlocked> | ||
</execution> | ||
<completed>false</completed> | ||
<checkouts class="hudson.util.PersistedList"/> | ||
</flow-build> |
13 changes: 13 additions & 0 deletions
13
...tionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/log
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Started | ||
[8mha:////4LSn6sjy3SQJvLr4M0Jcw5zYiu9jzzxAhCQhf5ciKGcGAAAAoh+LCAAAAAAAAP9tjTEOwjAQBM8BClpKHuFItIiK1krDC0x8GCfWnbEdkooX8TX+gCESFVvtrLSa5wtWKcKBo5UdUu8otU4GP9jS5Mixv3geZcdn2TIl9igbHBs2eJyx4YwwR1SwULBGaj0nRzbDRnX6rmuvydanHMu2V1A5c4MHCFXMWcf8hSnC9jqYxPTz/BXAFEIGsfuclm8zQVqFvQAAAA==[0m[Pipeline] Start of Pipeline | ||
[8mha:////4FLPcBhXXN+T+Uy5Bq+9NjiuG45smS/CK+MQ8sUKcTBsAAAApR+LCAAAAAAAAP9tjTEOwjAUQ3+KOrAycohUghExsUZZOEFIQkgb/d8mKe3EibgadyBQiQlLlmxL1nu+oE4RjhQdby12HpP2vA+jK4lPFLtroIm3dOGaMFGwXNpJkrGnpUrKFhaxClYC1hZ1oOTRZdiIVt1VExS65pxj2Q4CKm8GeAAThZxVzN8yR9jeRpMIf5y/AJj7DGxXvP/86jduZBmjwAAAAA==[0m[Pipeline] stage | ||
[8mha:////4MPOLP4Go7JuW3NkAKhksIfyE+NroTrcISNM8xfRFLQ8AAAApR+LCAAAAAAAAP9tjTEOwjAUQ3+KOrAycoh0gA0xsUZZOEFIQkgb/d8mKe3EibgadyBQiQlLlmxL1nu+oE4RjhQdby12HpP2vA+jK4lPFLtroIm3dOGaMFGwXNpJkrGnpUrKFhaxClYC1hZ1oOTRZdiIVt1VExS65pxj2Q4CKm8GeAAThZxVzN8yR9jeRpMIf5y/AJj7DGxXvP/86jfoP95RwAAAAA==[0m[Pipeline] { (stage) | ||
[8mha:////4E53KhegWm+s/q0TJkIC5MI9kTq62Eqnzz2Qdi1URRTJAAAAoh+LCAAAAAAAAP9tjTEOAiEURD9rLGwtPQTbaGWsbAmNJ0AWEZb8zwLrbuWJvJp3kLiJlZNMMm+a93rDOic4UbLcG+wdZu14DKOti0+U+lugiXu6ck2YKRguzSSpM+cFJRUDS1gDKwEbgzpQdmgLbIVXD9UGhba9lFS/o4DGdQM8gYlqLiqVL8wJdvexy4Q/z18BzLEA29ce4gdpL1fxvAAAAA==[0m[Pipeline] sleep | ||
Sleeping for 30 sec | ||
[8mha:////4G8hLCAAqKEvMe92YhTNPJa4MSOZpWK2lhgTDgEHbCXUAAAAoh+LCAAAAAAAAP9tjTEOAiEURD9rLGwtPQTbGBtjZUtoPAGyiLDkfxZYdytP5NW8g8RNrJxkknnTvNcb1jnBiZLl3mDvMGvHYxhtXXyi1N8CTdzTlWvCTMFwaSZJnTkvKKkYWMIaWAnYGNSBskNbYCu8eqg2KLTtpaT6HQU0rhvgCUxUc1GpfGFOsLuPXSb8ef4KYI6xADvU7j8OXFZ7vAAAAA==[0m[Pipeline] } | ||
[8mha:////4AnScT3OQumBbV+luAyxvhEcCl/8MozDCcq/aC6iNLpjAAAAox+LCAAAAAAAAP9tjTEOAiEURD9rLGwtPQRbWFgYK1tC4wmQRYQl/7PAult5Iq/mHSRuYuUkk8yb5r3esM4JTpQs9wZ7h1k7HsNo6+ITpf4WaOKerlwTZgqGSzNJ6sx5QUnFwBLWwErAxqAOlB3aAlvh1UO1QaFtLyXV7yigcd0AT2CimotK5Qtzgt197DLhz/NXAHOMBdihdv8BHeBS2LwAAAA=[0m[Pipeline] // stage | ||
[8mha:////4PTj6M4JscP6Gdk49EfTAaLMCwLZYd9IOq+brFvOiJPAAAAAph+LCAAAAAAAAP9tjUEKwjAURH8qXbh16SFScCWIK7chG08QkxjThv/bJLVdeSKv5h2MFlw5MDAzMLznC+oU4UjR8dZi5zFpz/swupL4RLG7Bpp4SxeuCRMFy6WdJBl7WqqkbGERq2AlYG1RB0oeXYaNaNVdNUGha845lu0goPJmgAcwUchZxfwtc4TtbTSJ8Mf5C4C5z8B2xfvPr34DrZTeycAAAAA=[0m[Pipeline] timeout | ||
Timeout set to expire in 10 min | ||
[8mha:////4M9FYx/jFzgoF1Ji4m6uzCtxEvJBQzBzYoKBBTbKepUTAAAApR+LCAAAAAAAAP9tjTEOwjAUQ3+KOrAycoh0BSEm1igLJwhJCGmj/9skpZ04EVfjDgQqMWHJkm3Jes8X1CnCkaLjrcXOY9Ke92F0JfGJYncNNPGWLlwTJgqWSztJMva0VEnZwiJWwUrA2qIOlDy6DBvRqrtqgkLXnHMs20FA5c0AD2CikLOK+VvmCNvbaBLhj/MXAHOfge2K959f/QbB16AVwAAAAA==[0m[Pipeline] { | ||
[8mha:////4O/MG/IybiYM4oG30m877qNjUwTyRLwWY87qTVAOsZwoAAAAoh+LCAAAAAAAAP9tjTEOwjAQBDdBFLSUPMKBEiEqWisNLzCJMU6su2BfSCpexNf4AxGRqNhqZ5p5vbFMEUeOTjWWWk+p8qoLvZueGji218CDaviiKqbEwarSDiXX9jRjyWIxL8ux0FhZqgInT06w1o15mCIYcsVZ4uQOGrmv73gi01NZTJQvjBGbW18npl/nbwBjJ8j2gny37T6VOYoyvQAAAA==[0m[Pipeline] sleep | ||
Sleeping for 30 sec |
5 changes: 5 additions & 0 deletions
5
...stTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/log-index
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
1232 5 | ||
1252 | ||
2157 8 | ||
2189 | ||
2789 10 |
Binary file added
BIN
+5.14 KB
...Test/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/program.dat
Binary file not shown.
26 changes: 26 additions & 0 deletions
26
.../stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/workflow/10.xml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?xml version='1.1' encoding='UTF-8'?> | ||
<Tag plugin="[email protected]_ed8a_573"> | ||
<node class="cps.n.StepAtomNode" plugin="[email protected]_2c931e7935"> | ||
<parentIds> | ||
<string>9</string> | ||
</parentIds> | ||
<id>10</id> | ||
<descriptorId>org.jenkinsci.plugins.workflow.steps.SleepStep</descriptorId> | ||
</node> | ||
<actions> | ||
<cps.a.ArgumentsActionImpl plugin="[email protected]_2c931e7935"> | ||
<arguments> | ||
<entry> | ||
<string>time</string> | ||
<long>30</long> | ||
</entry> | ||
</arguments> | ||
<sensitiveVariables/> | ||
<isUnmodifiedBySanitization>true</isUnmodifiedBySanitization> | ||
</cps.a.ArgumentsActionImpl> | ||
<wf.a.TimingAction> | ||
<startTime>1722980005296</startTime> | ||
</wf.a.TimingAction> | ||
<s.a.LogStorageAction/> | ||
</actions> | ||
</Tag> |
12 changes: 12 additions & 0 deletions
12
...t/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/workflow/2.xml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version='1.1' encoding='UTF-8'?> | ||
<Tag plugin="[email protected]_ed8a_573"> | ||
<node class="org.jenkinsci.plugins.workflow.graph.FlowStartNode"> | ||
<parentIds/> | ||
<id>2</id> | ||
</node> | ||
<actions> | ||
<wf.a.TimingAction> | ||
<startTime>1722979974868</startTime> | ||
</wf.a.TimingAction> | ||
</actions> | ||
</Tag> |
26 changes: 26 additions & 0 deletions
26
...t/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/workflow/3.xml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?xml version='1.1' encoding='UTF-8'?> | ||
<Tag plugin="[email protected]_ed8a_573"> | ||
<node class="cps.n.StepStartNode" plugin="[email protected]_2c931e7935"> | ||
<parentIds> | ||
<string>2</string> | ||
</parentIds> | ||
<id>3</id> | ||
<descriptorId>org.jenkinsci.plugins.workflow.support.steps.StageStep</descriptorId> | ||
</node> | ||
<actions> | ||
<s.a.LogStorageAction/> | ||
<cps.a.ArgumentsActionImpl plugin="[email protected]_2c931e7935"> | ||
<arguments> | ||
<entry> | ||
<string>name</string> | ||
<string>stage</string> | ||
</entry> | ||
</arguments> | ||
<sensitiveVariables/> | ||
<isUnmodifiedBySanitization>true</isUnmodifiedBySanitization> | ||
</cps.a.ArgumentsActionImpl> | ||
<wf.a.TimingAction> | ||
<startTime>1722979974972</startTime> | ||
</wf.a.TimingAction> | ||
</actions> | ||
</Tag> |
19 changes: 19 additions & 0 deletions
19
...t/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/workflow/4.xml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version='1.1' encoding='UTF-8'?> | ||
<Tag plugin="[email protected]_ed8a_573"> | ||
<node class="cps.n.StepStartNode" plugin="[email protected]_2c931e7935"> | ||
<parentIds> | ||
<string>3</string> | ||
</parentIds> | ||
<id>4</id> | ||
<descriptorId>org.jenkinsci.plugins.workflow.support.steps.StageStep</descriptorId> | ||
</node> | ||
<actions> | ||
<wf.a.BodyInvocationAction/> | ||
<wf.a.LabelAction> | ||
<displayName>stage</displayName> | ||
</wf.a.LabelAction> | ||
<wf.a.TimingAction> | ||
<startTime>1722979974988</startTime> | ||
</wf.a.TimingAction> | ||
</actions> | ||
</Tag> |
26 changes: 26 additions & 0 deletions
26
...t/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/workflow/5.xml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?xml version='1.1' encoding='UTF-8'?> | ||
<Tag plugin="[email protected]_ed8a_573"> | ||
<node class="cps.n.StepAtomNode" plugin="[email protected]_2c931e7935"> | ||
<parentIds> | ||
<string>4</string> | ||
</parentIds> | ||
<id>5</id> | ||
<descriptorId>org.jenkinsci.plugins.workflow.steps.SleepStep</descriptorId> | ||
</node> | ||
<actions> | ||
<cps.a.ArgumentsActionImpl plugin="[email protected]_2c931e7935"> | ||
<arguments> | ||
<entry> | ||
<string>time</string> | ||
<long>30</long> | ||
</entry> | ||
</arguments> | ||
<sensitiveVariables/> | ||
<isUnmodifiedBySanitization>true</isUnmodifiedBySanitization> | ||
</cps.a.ArgumentsActionImpl> | ||
<wf.a.TimingAction> | ||
<startTime>1722979975077</startTime> | ||
</wf.a.TimingAction> | ||
<s.a.LogStorageAction/> | ||
</actions> | ||
</Tag> |
16 changes: 16 additions & 0 deletions
16
...t/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/workflow/6.xml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version='1.1' encoding='UTF-8'?> | ||
<Tag plugin="[email protected]_ed8a_573"> | ||
<node class="cps.n.StepEndNode" plugin="[email protected]_2c931e7935"> | ||
<parentIds> | ||
<string>5</string> | ||
</parentIds> | ||
<id>6</id> | ||
<startId>4</startId> | ||
</node> | ||
<actions> | ||
<wf.a.BodyInvocationAction/> | ||
<wf.a.TimingAction> | ||
<startTime>1722980005117</startTime> | ||
</wf.a.TimingAction> | ||
</actions> | ||
</Tag> |
15 changes: 15 additions & 0 deletions
15
...t/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/workflow/7.xml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version='1.1' encoding='UTF-8'?> | ||
<Tag plugin="[email protected]_ed8a_573"> | ||
<node class="cps.n.StepEndNode" plugin="[email protected]_2c931e7935"> | ||
<parentIds> | ||
<string>6</string> | ||
</parentIds> | ||
<id>7</id> | ||
<startId>8</startId> <!-- Manually edited to simulate corruption observed in the real world. --> | ||
dwnusbaum marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</node> | ||
<actions> | ||
<wf.a.TimingAction> | ||
<startTime>1722980005177</startTime> | ||
</wf.a.TimingAction> | ||
</actions> | ||
</Tag> |
26 changes: 26 additions & 0 deletions
26
...t/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/workflow/8.xml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?xml version='1.1' encoding='UTF-8'?> | ||
<Tag plugin="[email protected]_ed8a_573"> | ||
<node class="cps.n.StepStartNode" plugin="[email protected]_2c931e7935"> | ||
<parentIds> | ||
<string>7</string> | ||
</parentIds> | ||
<id>8</id> | ||
<descriptorId>org.jenkinsci.plugins.workflow.steps.TimeoutStep</descriptorId> | ||
</node> | ||
<actions> | ||
<s.a.LogStorageAction/> | ||
<cps.a.ArgumentsActionImpl plugin="[email protected]_2c931e7935"> | ||
<arguments> | ||
<entry> | ||
<string>time</string> | ||
<int>10</int> | ||
</entry> | ||
</arguments> | ||
<sensitiveVariables/> | ||
<isUnmodifiedBySanitization>true</isUnmodifiedBySanitization> | ||
</cps.a.ArgumentsActionImpl> | ||
<wf.a.TimingAction> | ||
<startTime>1722980005227</startTime> | ||
</wf.a.TimingAction> | ||
</actions> | ||
</Tag> |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yikes. Project Loom would be very welcome in code like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking more carefully through Guava's Javadoc I think I can use
FluentFuture
to simplify this.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually
FluentFuture
doesn't really make things any clearer, so I will leave it.