]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
mgr/cephadm: create thread to start event loop for ssh.py, and return results of...
authorMelissa <li.melissa.kun@gmail.com>
Tue, 20 Jul 2021 23:02:57 +0000 (19:02 -0400)
committerMelissa Li <li.melissa.kun@gmail.com>
Fri, 20 Aug 2021 18:27:45 +0000 (14:27 -0400)
commit068ac34a5f44a2ffd447e6e22d899df47bf773e8
tree58da2c734845ac60b06cbfecff69f0ed64ce9992
parent47624927105a822a9c76436e8d949502e15688a3
mgr/cephadm: create thread to start event loop for ssh.py, and return results of the async functions with get_result

The EventLoopThread class starts a thread and an event loop which runs forever. Coroutines are scheduled on the event loop by the `get_result` method which uses `run_coroutine_threadsafe` to return a concurrent.futures.Future, and ultimately the result with .result()

Fixes: https://tracker.ceph.com/issues/44676
Signed-off-by: Melissa Li <li.melissa.kun@gmail.com>
src/pybind/mgr/cephadm/module.py
src/pybind/mgr/cephadm/ssh.py