Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 703230 Details for
Bug 885405
mock hangs when rpm %check fails (reproducer)
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
Exit from logOutput if child dies
0001-util-Exit-from-logOutput-if-child-dies.patch (text/plain), 2.62 KB, created by
Cole Robinson
on 2013-02-27 01:55:05 UTC
(
hide
)
Description:
Exit from logOutput if child dies
Filename:
MIME Type:
Creator:
Cole Robinson
Created:
2013-02-27 01:55:05 UTC
Size:
2.62 KB
patch
obsolete
>From 43b80cd0d9201b5f462c1a67c64b6d079e419675 Mon Sep 17 00:00:00 2001 >Message-Id: <43b80cd0d9201b5f462c1a67c64b6d079e419675.1361929897.git.crobinso@redhat.com> >From: Cole Robinson <crobinso@redhat.com> >Date: Tue, 26 Feb 2013 20:02:58 -0500 >Subject: [PATCH] util: Exit from logOutput if child dies > >If a package build process is buggy, it can leave orphaned processes >hanging around even after rpmbuild has exited. If these processes >hold open file descriptors that mock is watching, then mock will >busy wait until the rpmbuild_timeout timeout is hit. I was actually >seeing this with qemu's test suite. > >Make logOutput watch the child process. If the child exits, and >there are orphaned processes, kill them. This should wake up the loop. >--- > py/mockbuild/util.py | 16 ++++++++++++++-- > 1 file changed, 14 insertions(+), 2 deletions(-) > >diff --git a/py/mockbuild/util.py b/py/mockbuild/util.py >index b32e1c5..e30dfc7 100644 >--- a/py/mockbuild/util.py >+++ b/py/mockbuild/util.py >@@ -230,7 +230,7 @@ def condEnvironment(env=None): > for k in env.keys(): > os.putenv(k, env[k]) > >-def logOutput(fds, logger, returnOutput=1, start=0, timeout=0, printOutput=False): >+def logOutput(fds, logger, returnOutput=1, start=0, timeout=0, printOutput=False, child=None, chrootPath=None): > output="" > done = 0 > >@@ -241,12 +241,24 @@ def logOutput(fds, logger, returnOutput=1, start=0, timeout=0, printOutput=False > fcntl.fcntl(fd, fcntl.F_SETFL, flags| os.O_NONBLOCK) > > tail = "" >+ childDead = False > while not done: > if (time.time() - start)>timeout and timeout!=0: > done = 1 > break > > i_rdy,o_rdy,e_rdy = select.select(fds,[],[],1) >+ >+ if not i_rdy and not o_rdy and not e_rdy: >+ if not childDead and child and child.poll() is not None: >+ logger.info("Child pid '%s' is dead" % child.pid) >+ childDead = True >+ >+ if chrootPath: >+ logger.info("Child dead, killing orphans") >+ orphansKill(chrootPath) >+ >+ > for s in i_rdy: > # slurp as much input as is ready > input = s.read() >@@ -325,7 +337,7 @@ def do(command, shell=False, chrootPath=None, cwd=None, timeout=0, raiseExc=True > > # use select() to poll for output so we dont block > output = logOutput([child.stdout, child.stderr], >- logger, returnOutput, start, timeout, printOutput=printOutput) >+ logger, returnOutput, start, timeout, printOutput=printOutput, child=child, chrootPath=chrootPath) > > except: > # kill children if they arent done >-- >1.8.1.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 885405
:
660206
|
660207
|
660208
| 703230 |
816540