ansible-collections / ansible-collections/cloud.common
Fall back to regular execution if socket can't be opened
- Dominant language
- Python
- Stars
- 19
- Forks
- 28
- PR merge metrics
- No merged PRs in 30d
Description
##### SUMMARY
##### ISSUE TYPE
- Feature Idea
##### COMPONENT NAME
TURBO_MODE in cloud.common
##### ADDITIONAL INFORMATION
We are using the `turbbo_mode` together with an Ansible operator, written with the help of the operator-sdk. We have many 1000s of objects in our cluster, resulting in many parallel reconciliations and executions of the `community.kubernetes` collection.
Activating the `turbo_mode` helps to increase the performance drastically. After facing out of memory issues with the `turbo_mode` (see https://github.com/operator-framework/operator-sdk/issues/5246#issuecomment-1232784978), we needed to make a couple of modifications already though:
- Only unlink if the socket is still present, otherwise processes will stay around, complaining that they can't unlink, ultimately resulting in OOM: https://github.com/operator-framework/operator-sdk/issues/5246#issuecomment-1253825975
- Trying to connect to the socket (https://github.com/stiller-leser/cloud.common/blob/main/plugins/module_utils/turbo/common.py#L54) can fail with `FileNotFoundError` and ultimately a `raise` if the socket can't be created and / or is currently not existing (bbecause it was just termnated). Increasing the sleep (https://github.com/stiller-leser/cloud.common/blob/main/plugins/module_utils/turbo/common.py#L61) and increasing the TTL (https://github.com/stiller-leser/cloud.common/blob/main/plugins/module_utils/turbo/module.py#L142) via the environment variable helps somewhat
As we have many parallel reconciliations running, all calling the `community.kubernetes` collection (hence all resulting in the same socket name, resulting in the conflicts described above), it would be great to enable the possibility to instead of raising here https://github.com/stiller-leser/cloud.common/blob/main/plugins/module_utils/turbo/common.py#L60 having the code fall back to a regular module execution.
Best regards,
stiller-leser
Contributor guide
Research direction
Start in plugins/module_utils/turbo/common.py around the socket connection at lines 54-61, then review the TTL handling in plugins/module_utils/turbo/module.py around line 142. The change is complete when a missing or unavailable socket falls back to regular module execution instead of raising; no tests are named in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devops
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100