Long story short
I use aiofile to check health of consumers. Some file is being touched during consumer process and then in k8s liveness probe I compare modified time.
Unfortunately I noticed a memory leak that was caused by liveness probe.
Expected behavior
I expect no memory leaks :)
Actual behavior
There is one.
Steps to reproduce
Here code for reproduction:
# liveness_probe/__main__.py
import asyncio
async def liveness_probe() -> None:
import aiofile
aiofile
if __name__ == "__main__":
asyncio.run(liveness_probe())
Aiofile should be imported inside function.
livenessProbe:
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 10
exec:
command:
- python
- -m
- liveness_probe
Just probe inside k8s Deployment.
Environment info
k8s version: 1.21.8
aiofile version: 3.8.0 - 3.8.8 (didn't check other)
python version: 3.11.3 - 3.11.6 (didn't check other)
I have been produced this problem with implementations:
✅ export CAIO_IMPL=linux
✅ export CAIO_IMPL=thread
✅ export CAIO_IMPL=python
Additional info
Here are graphs of the increase in the amount of memory consumed in pod:


Long story short
I use aiofile to check health of consumers. Some file is being touched during consumer process and then in k8s liveness probe I compare modified time.
Unfortunately I noticed a memory leak that was caused by liveness probe.
Expected behavior
I expect no memory leaks :)
Actual behavior
There is one.
Steps to reproduce
Here code for reproduction:
Aiofile should be imported inside function.
Just probe inside k8s Deployment.
Environment info
k8s version: 1.21.8
aiofile version: 3.8.0 - 3.8.8 (didn't check other)
python version: 3.11.3 - 3.11.6 (didn't check other)
I have been produced this problem with implementations:
✅ export CAIO_IMPL=linux
✅ export CAIO_IMPL=thread
✅ export CAIO_IMPL=python
Additional info
Here are graphs of the increase in the amount of memory consumed in pod:

