-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rbd_utils: wrap blocking calls in tpool.Proxy()
librbd is a Python binding around a C library, which is not aware of eventlet - all the calls to the functions from this library will block the whole nova-compute process for duration of a call. To make sure nova-compute remains responsive we need to wrap all the calls in tpool.Proxy() eventlet helper, that switches the execution context back to the event loop, while the call is executed in a native OS thread from a pool. Prefer tpool.Proxy() to tpool.execute() here as the former allows for wrapping objects and automatically executes all the method calls in native OS threads, while the latter needs to be applied to each method call in the code repeatedly. Existing calls are modified for the sake of consistency. Closes-Bug: #1607461 Change-Id: I743ab372332eb656258a476ae91f5e8fd2cbdc99 (cherry picked from commit 3405a28)
- Loading branch information
Roman Podoliaka
committed
Sep 2, 2016
1 parent
cc2105f
commit e2b2f6e
Showing
2 changed files
with
45 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters