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

Diagnosis/recovery for infinite loop in AbstractTestResultAction.buildDataSet #13

Merged

Conversation

jglick
Copy link
Member

@jglick jglick commented Feb 18, 2015

A Jenkins instance running 1.554.3 was observed to crash in a thread running

Handling GET /job/…/test/trend : …
  at java.lang.OutOfMemoryError.<init>()V (Unknown Source)
  at java.util.Arrays.copyOf([Ljava/lang/Object;I)[Ljava/lang/Object; (Unknown Source)
  at java.util.ArrayList.grow(I)V (Unknown Source)
  at java.util.ArrayList.ensureCapacityInternal(I)V (Unknown Source)
  at java.util.ArrayList.add(Ljava/lang/Object;)Z (Unknown Source)
  at hudson.util.DataSetBuilder.add(Ljava/lang/Number;Ljava/lang/Comparable;Ljava/lang/Comparable;)V (DataSetBuilder.java:52)
  at hudson.tasks.test.AbstractTestResultAction.buildDataSet(Lorg/kohsuke/stapler/StaplerRequest;)Lorg/jfree/data/category/CategoryDataset; (AbstractTestResultAction.java:260)
  at hudson.tasks.test.AbstractTestResultAction.doGraph(Lorg/kohsuke/stapler/StaplerRequest;Lorg/kohsuke/stapler/StaplerResponse;)V (AbstractTestResultAction.java:221)
  at hudson.tasks.test.TestResultProjectAction.doTrend(Lorg/kohsuke/stapler/StaplerRequest;Lorg/kohsuke/stapler/StaplerResponse;)V (TestResultProjectAction.java:97)
  at …

where (according to Eclipse Memory Analyzer) the DataSetBuilder had accumulated hundreds of megabytes of objects. I hypothesize that this loop fails to terminate. This patch tries to detect (and recover from) the most plausible proximate cause, that an action is attached simultaneously to two builds.

@reviewbybees (ref. ZD-24012)

@jenkinsadmin
Copy link
Member

Thank you for a pull request! Please check this document for how the Jenkins project handles pull requests

@jtnord
Copy link
Member

jtnord commented Feb 19, 2015

👍

jglick added a commit that referenced this pull request Feb 23, 2015
…Set-loop

Diagnosis/recovery for infinite loop in AbstractTestResultAction.buildDataSet
@jglick jglick merged commit e8cf137 into jenkinsci:master Feb 23, 2015
@jglick jglick deleted the AbstractTestResultAction-buildDataSet-loop branch February 23, 2015 13:11
@kutzi
Copy link
Member

kutzi commented Nov 23, 2015

There might have been a similar issue in https://issues.jenkins-ci.org/browse/JENKINS-31660 (infinite loop in TestResult.getPreviousResult) which has not been fixed by this.
Maybe you have some ideas, what might be going on there

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.

5 participants