Commit 923d6d7
committed
[vdk-plugins] vdk-kerberos-auth: Separate async event loop
The minikerberos authenticator relies on an async kerberos client to speed up some of its
processes. This client uses `asyncio.run()` to execute async operations. As can be seen from the source
code of asyncio, https://github.com/python/cpython/blob/3.10/Lib/asyncio/runners.py, the `run()` method
creates a new event loop and sets it as the [default loop](https://github.com/python/cpython/blob/3.10/Lib/asyncio/runners.py#L41).
When all async operations are finished, the loop it terminated and all tasks are cleaned. This is fine
in general, as long as other components don't rely on the main event loop.
If they do, however, we could end up in a situation, where the kerberos plugin closes the asyncio
main event loop, and breaks the other components that rely on the same thread.
To avoid issues with multiple components relying on the asyncio main event loop, this change introduces
a separate event loop for the minikerberos authenticator, thus keeping kerberos operations away of the main
event loop.
Testing done: Functional test added.
Signed-off-by: Andon Andonov <andonova@vmware.com>1 parent 303cd2c commit 923d6d7
File tree
2 files changed
+19
-1
lines changed- projects/vdk-plugins/vdk-kerberos-auth
- src/vdk/plugin/kerberos
- tests/jobs/test-job
2 files changed
+19
-1
lines changedLines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
79 | 84 | | |
80 | 85 | | |
81 | 86 | | |
| |||
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
0 commit comments