swift-bench logs stacktracing (when using v2)

Bug #1105133 reported by Chmouel Boudjnah
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Fix Released
Undecided
Kun Huang

Bug Description

I am getting this when running swift-bench in 2.0 mode :

stack@devstack:~$ swift-bench -V 2.0 -U admin:admin -K KAKA -A http://localhost:5000/v2.0
swift-bench 2013-01-25 14:25:23,626 INFO Auth version: 2.0
Traceback (most recent call last):
  File "/usr/lib/python2.7/logging/__init__.py", line 846, in emit
    msg = self.format(record)
  File "/usr/lib/python2.7/logging/__init__.py", line 723, in format
    return fmt.format(record)
  File "/usr/lib/python2.7/logging/__init__.py", line 467, in format
    s = self._fmt % record.__dict__
KeyError: 'server'
Logged from file connectionpool.py, line 191
swift-bench 2013-01-25 14:25:25,605 INFO Auth version: 2.0
Traceback (most recent call last):
  File "/usr/lib/python2.7/logging/__init__.py", line 846, in emit
    msg = self.format(record)
  File "/usr/lib/python2.7/logging/__init__.py", line 723, in format
    return fmt.format(record)
  File "/usr/lib/python2.7/logging/__init__.py", line 467, in format
    s = self._fmt % record.__dict__
KeyError: 'server'
Logged from file connectionpool.py, line 191
swift-bench 2013-01-25 14:25:27,798 INFO 22 PUTS [0 failures], 10.7/s
swift-bench 2013-01-25 14:25:42,838 INFO 203 PUTS [0 failures], 11.9/s

Changed in swift:
status: New → Triaged
Revision history for this message
Kun Huang (academicgareth) wrote :

That logger = logging.getLogger() and follow settings change the work of root logger, like level or format
public module use its root.module will match these settings and response this, which results in that connectionpool could not find keyword "server"

To fix it, changing logger to module itself, just use logging.getLogger(__name__) is ok

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to swift (master)

Fix proposed to branch: master
Review: https://review.openstack.org/24579

Changed in swift:
assignee: nobody → Kun Huang (academicgareth)
status: Triaged → In Progress
Revision history for this message
David Kranz (david-kranz) wrote :

The fix seems to work. To me it would make more sense if swift-bench were part of swiftclient rather than swift. Then you could run it against different swift versions. Is there reason it is not?

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to swift (master)

Reviewed: https://review.openstack.org/24579
Committed: http://github.com/openstack/swift/commit/45dda5e3565d1a4c7dc030bcf674b681996b9cb2
Submitter: Jenkins
Branch: master

commit 45dda5e3565d1a4c7dc030bcf674b681996b9cb2
Author: Kun Huang <email address hidden>
Date: Sun Mar 17 01:59:40 2013 +0800

    Change logger name to module itself instead of root

    Using root logger will make public module log failed by unknow keyword.
    Just change the logger name to module itself could dismiss this impact.
    And disable logger.propagate could prevent double outputing.

    Change-Id: I18696d124ebac9ca970d502558972e51de759097
    Fixes: bug #1105133

Changed in swift:
status: In Progress → Fix Committed
Changed in swift:
milestone: none → 1.9.0
Thierry Carrez (ttx)
Changed in swift:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.