My app tries to establish a connection with a real drone once per 5 secs.
if not self.is_drone_connected():
try:
self.connection_lock.acquire()
self.drone = olympe.Drone(self.args.anafi_drone_ip)
if self.drone.connect():
self.logger.info("drone connected")
else:
self.logger.error("drone NOT connected")
self.connection_lock.release()
except Exception as e:
self.logger.error(f"exception on drone_connection_management: {e}, exit required")
os._exit(0)
finally:
if self.connection_lock.locked():
self.connection_lock.release()
This runs well for pretty much exactly 7 minutes:
2022-09-02 19:18:27,936 [ERROR] olympe.drone - _do_connect - '192.168.42.1 connection retries failed
2022-09-02 19:18:34,192 [ERROR] olympe.drone - connect - '192.168.42.1 connection timed out
2022-09-02 19:18:34,195 [ERROR] parrot: drone NOT connected
After this time of unsuccessful attempts I see the memory consumption going up in htop
(about 1MB per attempt).
Finally the SDK excepts (after spitting Too many open files
and excepts with Unable to create pomp timer
:
2022-09-02 19:25:34,195 [ERROR] ulog - pomp - eventfd err=24(Too many open files)
ERROR:root:Unhandled exception: Traceback (most recent call last):
File "</home/pi/anafi-pi/./main.py>", line 3, in <module>
File "<main>", line 1121, in <module>
File "<parrot>", line 205, in drone_connection_management
File "/home/pi/code/parrot-groundsdk/out/olympe-linux/staging/usr/lib/python/site-packages/olympe/mixins/streaming.py", line 36, in __init__
super().__init__(*args, **kwds)
File "/home/pi/code/parrot-groundsdk/out/olympe-linux/staging/usr/lib/python/site-packages/olympe/mixins/mission.py", line 36, in __init__
super().__init__(ip_addr, *args, name=name, **kwds)
File "/home/pi/code/parrot-groundsdk/out/olympe-linux/staging/usr/lib/python/site-packages/olympe/mixins/media.py", line 37, in __init__
super().__init__(*args, **kwds)
File "/home/pi/code/parrot-groundsdk/out/olympe-linux/staging/usr/lib/python/site-packages/olympe/arsdkng/controller.py", line 105, in __init__
super().__init__(
File "/home/pi/code/parrot-groundsdk/out/olympe-linux/staging/usr/lib/python/site-packages/olympe/arsdkng/cmd_itf.py", line 216, in __init__
self._scheduler = Scheduler(self._thread_loop, name=self._name)
File "/home/pi/code/parrot-groundsdk/out/olympe-linux/staging/usr/lib/python/site-packages/olympe/scheduler.py", line 421, in __init__
super().__init__(DefaultScheduler(*args, **kwds))
File "/home/pi/code/parrot-groundsdk/out/olympe-linux/staging/usr/lib/python/site-packages/olympe/scheduler.py", line 113, in __init__
self._attr.default.subscribers_thread_loop = Loop(
File "/home/pi/code/parrot-groundsdk/out/olympe-linux/staging/usr/lib/python/site-packages/olympe/concurrent/__init__.py", line 131, in __init__
self._task_timer = self.create_timer(self._task_timer_cb)
File "/home/pi/code/parrot-groundsdk/out/olympe-linux/staging/usr/lib/python/site-packages/olympe/concurrent/__init__.py", line 626, in create_timer
raise RuntimeError("Unable to create pomp timer")
RuntimeError: Unable to create pomp timer
This is reproducible. Only chance to automatically survive this is leaving the app and restarting via an outer bash script.