Comment 6 for bug 1969373

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance_store (stable/yoga)

Reviewed: https://review.opendev.org/c/openstack/glance_store/+/839203
Committed: https://opendev.org/openstack/glance_store/commit/c6716cb8fbbdd75b3c5ce36f5fc9cede8b83bc0d
Submitter: "Zuul (22348)"
Branch: stable/yoga

commit c6716cb8fbbdd75b3c5ce36f5fc9cede8b83bc0d
Author: whoami-rajat <email address hidden>
Date: Mon Apr 18 21:43:14 2022 +0530

    Correct retry interval during attach volume

    When we try to simultaneously attach same volume multiple times
    (multiattach), there are multiple attachments created, suppose
    attachA and attachB. If attachA marks the volume "reserved" then
    attachB can't proceed until the volume is in "in-use" or "available"
    state. We retry until we reach any of these states for which we use
    the retrying library.

    The retrying library defaults to 1 second retry[1] (5 times) which causes
    the original failure as the volume takes time to transition between
    "reserved" -> "in-use" state. This patch corrects it by adding an
    exponential retry time and max exponential retry i.e.

    1: 2 ** 1 = 2 seconds
    2: 2 ** 2 = 4 seconds
    3: 2 ** 3 = 8 seconds
    4: 2 ** 4 = 16 seconds (but max wait time is 10 seconds)
    5: 2 ** 5 = 32 seconds (but max wait time is 10 seconds)

    [1] https://github.com/rholder/retrying/blob/master/retrying.py#L84

    Closes-Bug: #1969373

    Change-Id: I0094b044085d7f92b07ea86236de3b6efd7d67ea
    (cherry picked from commit ba4af147fb93d522f8cf396098891f4cbe7b30fb)