Any way to get more information about "Process leaked file descriptors"?

362 views
Skip to first unread message

Kent Larsson

unread,
Sep 1, 2011, 5:27:08 AM9/1/11
to jenkins...@googlegroups.com
Hi!

I get this in our log file:

VARNING: Process leaked file descriptors. See http://wiki.jenkins-ci.org/display/JENKINS/Spawning+processes+from+build for more information
java.lang.Exception
    at hudson.Proc$LocalProc.join(Proc.java:329)
    at hudson.Launcher$ProcStarter.join(Launcher.java:336)
    at hudson.tasks.Ant.perform(Ant.java:216)
    at hudson.plugins.templateproject.ProxyBuilder.perform(ProxyBuilder.java:83)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
    at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:682)
    at hudson.model.Build$RunnerImpl.build(Build.java:178)
    at hudson.model.Build$RunnerImpl.doRun(Build.java:139)
    at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:448)
    at hudson.model.Run.run(Run.java:1376)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:230)

Is there a way to know when in the build process the file descriptor was leaked? Or get any tip at all on what to investigate? Our build scripts are huge and calling each other in a pretty complex way (which should be fixed, I know).

Best regards, Kent

Kent Larsson

unread,
Sep 1, 2011, 11:22:10 AM9/1/11
to jenkins...@googlegroups.com
Hi!

I´ll answer my own question now, after looking through the Jenkins source code. :-)

In Proc.java there you can find this declaration:

    /**
     * Debug switch to have the thread display the process it's waiting for.
     */
    public static boolean SHOW_PID = false;

Setting SHOW_PID = true will get more information about the process we are waiting for. However, you have to compile Jenkins yourself to enable it as far as I could see (I didn´t look at any other files, i grepped my way to it).

If any Jenkins developers are here. Is there a way to turn it on through some configuration file perhaps?

And would it be possible to see the whole process tree, to make it easier to find the problematic part in case one build script calls another one, and so on.

Best regards, Kent
Reply all
Reply to author
Forward
0 new messages