Workflow: load a class from flow.groovy hangs jenkins, can't be killed in UI

125 views
Skip to first unread message

Martin d'Anjou

unread,
Nov 14, 2015, 9:50:15 PM11/14/15
to Jenkins Users
I have a workflow job that cannot be killed, unless the java process running Jenkins is killed. I think it is a bug. Here are the steps to reproduce:

// Workflow job:
def flow
node() {
    git 'file:///home/martin/git/workflow-job-definition.git'
    flow = load 'flow.groovy'
}
def m = flow.createMyClass("Joe")
assert m.getName() == "Joe"

// Content of flow.groovy
class MyClass {
  String name
  MyClass(String name) {
    this.name = name
  }
  String getName() {
    return "the name is: "+name
  }
}

MyClass createMyClass(String name) {
  return new MyClass(name)
}
return this

Once the job has started, it consumes more and more memory. To kill it, I have to use kill -11 on the java process id (control-c is not enough). When Jenkins restarts, it resumes the hanging job, but this time I can kill it from the UI. I use Jenkins 1.638, and Workflow 1.11, on linux mint

I tried looking for similar issues, but I cannot find if this has already been reported.

Martin

Baptiste Mathus

unread,
Nov 19, 2015, 5:47:50 AM11/19/15
to jenkins...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/ab0c0a64-977a-4f79-9199-33893abec670%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Baptiste <Batmat> MATHUS - http://batmat.net
Sauvez un arbre,
Mangez un castor !

Martin d'Anjou

unread,
Nov 19, 2015, 9:34:44 AM11/19/15
to Jenkins Users, bma...@batmat.net
It works but I am running into a significant performance degradation before the job is killed. I see a memory leak and an IO exception in the jenkins log:

Nov 19, 2015 8:34:41 AM org.jenkinsci.plugins.workflow.job.WorkflowRun copyLogs
WARNING: null
java.io.IOException: Unable to read /home/martin/.jenkins/jobs/workflow-test/jobs/workflow-hangs/builds/4/workflow/10.xml
    at hudson.XmlFile.read(XmlFile.java:146)
...
Caused by: java.lang.OutOfMemoryError: GC overhead limit exceeded

While this happens, Jenkins becomes very slow (minutes to get any response from the UI), memory usage grows to about 2.5G, and each click can take one to two minutes to respond.

Should I open a new bug? Should I post the entire stacktrace (it is long)?

Thanks,
Martin
Reply all
Reply to author
Forward
0 new messages