Comment 17 for bug 1680183

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to neutron (master)

Reviewed: https://review.opendev.org/661257
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=6ea01444dd75d2d15658c808e052143deaf66543
Submitter: Zuul
Branch: master

commit 6ea01444dd75d2d15658c808e052143deaf66543
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Fri May 24 09:32:41 2019 +0000

    Add Timer context manager class

    This class creates a context that:
    * Triggers a timeout exception if the timeout is set.
    * Returns the time elapsed since the context was initialized.
    * Returns the time spent in the context once it's closed.

    The timeout exception can be suppressed; when the time expires, the
    context finishes without rising TimerTimeout.

    This class can be used to execute blocking methods and finish them if
    there is no return. For example, in the followup patch [1], this class
    is used in the method "neutron.agent.linux.ip_lib.ip_monitor" to control
    how much time the blocking function "IPRSocket.get" is being called. By
    using this strategy the method "ip_monitor" can be finished gracefully
    using an external event signal in the main loop.

    [1] https://review.opendev.org/#/c/660611/

    Change-Id: I1f33535b201d49b875437bcc3397fcb465118064
    Related-Bug: #1680183