95%的时间,作业运行良好但有时我在一个或多个作业中收到以下错误消息:
Building on master in workspace C:\Program Files (x86)\Jenkins\jobs\PatchsetCPPCheck\workspace Checkout:workspace / C:\Program Files (x86)\Jenkins\jobs\PatchsetCPPCheck\workspace - hudson.remoting.LocalChannel@1a046fe Using strategy: Gerrit Trigger Last Built Revision: Revision 2ff5e3449041916e21fe7a4833a2babcfef45225 (master) Fetching changes from 1 remote Git repository Fetching upstream changes from origin Commencing build of Revision 1eec024d8a125a42b563011468bb19a87e1da2ea (master) Checking out Revision 1eec024d8a125a42b563011468bb19a87e1da2ea (master) Cleaning workspace Resetting working tree FATAL: Invalid id: Process leaked file descriptors. See http://wiki.jenkins-ci.org/display/JENKINS/Spawning+processes+from+build for more information java.lang.IllegalArgumentException: Invalid id: Process leaked file descriptors. See http://wiki.jenkins-ci.org/display/JENKINS/Spawning+processes+from+build for more information at org.eclipse.jgit.lib.ObjectId.fromString(ObjectId.java:232) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.doRevList(CliGitAPIImpl.java:1278) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.revList(CliGitAPIImpl.java:1264) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.isCommitInRepo(CliGitAPIImpl.java:1289) at hudson.plugins.git.GitAPI.isCommitInRepo(GitAPI.java:189) at hudson.plugins.git.GitSCM.computeChangeLog(GitSCM.java:1286) at hudson.plugins.git.GitSCM.access$1300(GitSCM.java:57) at hudson.plugins.git.GitSCM$4.invoke(GitSCM.java:1251) at hudson.plugins.git.GitSCM$4.invoke(GitSCM.java:1205) at hudson.FilePath.act(FilePath.java:905) at hudson.FilePath.act(FilePath.java:878) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1205) at hudson.model.AbstractProject.checkout(AbstractProject.java:1369) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:676) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:581) at hudson.model.Run.execute(Run.java:1593) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:242)
谁可以帮我这个事?
解决方法
> ‘at’ command可用于在后台启动进程.
>使用包装器脚本并通过它启动程序.
>对于Windows XP及更高版本,将安排永久任务和强制
从ant脚本运行它.
编辑:
描述了这个问题的原因,
Jenkins and the child process are connected by three pipes
(stdin/stdout/stderr.) This allows Jenkins to capture the output from
the child process. Since the child process may write a lot of data to
the pipe and quit immediately after that,Jenkins needs to make sure
that it drained the pipes before it considers the build to be over.
Jenkins does this by waiting for EOF.The complication happens when those file descriptors are inherited to
other processes. Let’s say the child process forks another process to
the background. The background process (AKA daemon) inherits all the
file descriptors of the parent,including the writing side of the
stdout/stderr pipes that connect the child process and Jenkins. If the
daemon forgets to close them,Jenkins won’t get EOF for pipes even
when the child process exits,because daemon still have those
descriptors open. That’s how this problem happens.A good daemon program closes all file descriptors to avoid problems like this (So that jenkins can read EOF)
为了防止守护程序具有打开的文件描述符,一个进程(这是您的解决方法,可以是在后台运行的shell / windows脚本)将在后台运行以确保守护进程存在时,它会关闭所有文件描述符.