summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Treinish <mtreinish@kortar.org>2016-03-01 12:29:31 -0500
committerMatthew Treinish <mtreinish@kortar.org>2016-03-01 12:32:47 -0500
commite12fc216edf468b8a17e3cbddf26978d11cc8bc7 (patch)
tree8648a6246c0c65d72ed1940a2c9c0827f1969363
parentf4667bbba45c7919259e9ce0986a226e7d9c8ada (diff)
Add more debug logging for closed file issues
This commit adds additional debug logging to the subunit gearman worker to try and identify the source of the closed file bug we're hitting in production. This adds logging of the memory address where the cStringIO.StringIO objects before and after being pushed on the queue. It also adds a distinct message for the object if it's closed before or after being on the queue. Change-Id: I4a4f064e8885f8f9c8fc2974c0f71d837f41454e
Notes
Notes (review): Code-Review+2: Elizabeth K. Joseph <lyz@princessleia.com> Code-Review+2: Spencer Krum <nibz@spencerkrum.com> Workflow+1: Spencer Krum <nibz@spencerkrum.com> Code-Review+2: Sergey Lukjanov <slukjanov@mirantis.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Tue, 01 Mar 2016 23:59:53 +0000 Reviewed-on: https://review.openstack.org/286733 Project: openstack-infra/puppet-subunit2sql Branch: refs/heads/master
-rw-r--r--files/subunit-gearman-worker.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/files/subunit-gearman-worker.py b/files/subunit-gearman-worker.py
index 90be15a..5780f8d 100644
--- a/files/subunit-gearman-worker.py
+++ b/files/subunit-gearman-worker.py
@@ -86,7 +86,11 @@ class SubunitRetriever(threading.Thread):
86 job.sendWorkException( 86 job.sendWorkException(
87 'Unable to retrieve subunit stream'.encode('utf8')) 87 'Unable to retrieve subunit stream'.encode('utf8'))
88 else: 88 else:
89 logging.debug("Pushing subunit files.") 89 if subunit_io.closed:
90 logging.debug("Pushing closed subunit file: %s" %
91 subunit_io)
92 else:
93 logging.debug("Pushing subunit file: %s" % subunit_io)
90 out_event = fields.copy() 94 out_event = fields.copy()
91 out_event["subunit"] = subunit_io 95 out_event["subunit"] = subunit_io
92 self.subunitq.put(out_event) 96 self.subunitq.put(out_event)
@@ -180,7 +184,12 @@ class Subunit2SQLProcessor(object):
180 shell.CONF.set_override('artifacts', log_dir) 184 shell.CONF.set_override('artifacts', log_dir)
181 shell.CONF.set_override('run_meta', subunit) 185 shell.CONF.set_override('run_meta', subunit)
182 # Parse subunit stream and store in DB 186 # Parse subunit stream and store in DB
183 logging.debug('Converting Subunit V2 stream to SQL') 187 if subunit_v2.closed:
188 logging.debug('Trying to convert closed subunit v2 stream: %s to '
189 'SQL' % subunit_v2)
190 else:
191 logging.debug('Converting Subunit V2 stream: %s to SQL' %
192 subunit_v2)
184 stream = read_subunit.ReadSubunit(subunit_v2, 193 stream = read_subunit.ReadSubunit(subunit_v2,
185 targets=self.extra_targets) 194 targets=self.extra_targets)
186 results = stream.get_results() 195 results = stream.get_results()