fallocate_reserve is still broken on py3

Bug #1872553 reported by Tim Burke on 2020-04-13
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Undecided
Unassigned

Bug Description

We thought we fixed bug #1844368 -- but we only fixed up the WSGI servers. Which meant that if you put the config option in your [DEFAULT] section, your background daemons would blow up like

Traceback (most recent call last):
  File "/usr/local/bin/swift-account-replicator", line 7, in <module>
    exec(compile(f.read(), __file__, 'exec'))
  File "/vagrant/swift/bin/swift-account-replicator", line 34, in <module>
    run_daemon(AccountReplicator, conf_file, **options)
  File "/vagrant/swift/swift/common/daemon.py", line 276, in run_daemon
    log_name=kwargs.get('log_name'))
  File "/vagrant/swift/swift/common/utils.py", line 3021, in readconf
    conf = dict(c.items(section_name))
  File "/usr/lib/python3.6/configparser.py", line 858, in items
    return [(option, value_getter(option)) for option in d.keys()]
  File "/usr/lib/python3.6/configparser.py", line 858, in <listcomp>
    return [(option, value_getter(option)) for option in d.keys()]
  File "/usr/lib/python3.6/configparser.py", line 855, in <lambda>
    section, option, d[option], d)
  File "/usr/lib/python3.6/configparser.py", line 394, in before_get
    self._interpolate_some(parser, option, L, value, section, defaults, 1)
  File "/usr/lib/python3.6/configparser.py", line 444, in _interpolate_some
    "found: %r" % (rest,))
configparser.InterpolationSyntaxError: '%' must be followed by '%' or '(', found: '%'

Tim Burke (1-tim-z) on 2020-04-13
tags: added: python3

Reviewed: https://review.opendev.org/734721
Committed: https://git.openstack.org/cgit/openstack/swift/commit/?id=2854eddb4424327fc6dc9b7930fd2874b5b23df4
Submitter: Zuul
Branch: master

commit 2854eddb4424327fc6dc9b7930fd2874b5b23df4
Author: Tim Burke <email address hidden>
Date: Tue Jun 9 16:45:21 2020 -0700

    py3: (Better) fix percentages in configs

    We previously fixed a bunch of places, but not quite *all* the places;
    at the very least, some account-layer services (like the replicator and
    auditor IIRC) could still bomb out -- and it's important that
    replicators still respect fallocate_reserve!

    Now, do the NicerInterpolation thing every time we call readconf.
    Additionally, clean up the original fix to avoid globally
    monkey-patching configparser.

    Related-Bug: #1844368
    Closes-Bug: #1872553
    Change-Id: I4512e686cde37930f0482909f537220a57fef76b

Changed in swift:
status: In Progress → Fix Released

Reviewed: https://review.opendev.org/737070
Committed: https://git.openstack.org/cgit/openstack/swift/commit/?id=b40f25f9e41dcd77a4768b781ffe59f483911c4e
Submitter: Zuul
Branch: stable/ussuri

commit b40f25f9e41dcd77a4768b781ffe59f483911c4e
Author: Tim Burke <email address hidden>
Date: Tue Jun 9 16:45:21 2020 -0700

    py3: (Better) fix percentages in configs

    We previously fixed a bunch of places, but not quite *all* the places;
    at the very least, some account-layer services (like the replicator and
    auditor IIRC) could still bomb out -- and it's important that
    replicators still respect fallocate_reserve!

    Now, do the NicerInterpolation thing every time we call readconf.
    Additionally, clean up the original fix to avoid globally
    monkey-patching configparser.

    Related-Bug: #1844368
    Closes-Bug: #1872553
    Change-Id: I4512e686cde37930f0482909f537220a57fef76b
    (cherry picked from commit 2854eddb4424327fc6dc9b7930fd2874b5b23df4)

tags: added: in-stable-ussuri

Reviewed: https://review.opendev.org/737071
Committed: https://git.openstack.org/cgit/openstack/swift/commit/?id=bb1263b8d4211c198dc8d5e25b9ac4cd120ae56b
Submitter: Zuul
Branch: stable/train

commit bb1263b8d4211c198dc8d5e25b9ac4cd120ae56b
Author: Tim Burke <email address hidden>
Date: Tue Jun 9 16:45:21 2020 -0700

    py3: (Better) fix percentages in configs

    We previously fixed a bunch of places, but not quite *all* the places;
    at the very least, some account-layer services (like the replicator and
    auditor IIRC) could still bomb out -- and it's important that
    replicators still respect fallocate_reserve!

    Now, do the NicerInterpolation thing every time we call readconf.
    Additionally, clean up the original fix to avoid globally
    monkey-patching configparser.

    Related-Bug: #1844368
    Closes-Bug: #1872553
    Change-Id: I4512e686cde37930f0482909f537220a57fef76b
    (cherry picked from commit 2854eddb4424327fc6dc9b7930fd2874b5b23df4)

tags: added: in-stable-train
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers