zebrunner / mcloud-agent

18 stars 11 forks source link

limit number of retries on failures for devices containers #331

Open vdelendik opened 2 months ago

vdelendik commented 2 months ago

to avoid constant containers restart due to the failures we should find a way to register meaningful amount of restart we allow for every container.

It might help to solve as minimal issue with device unauthorized state which is fixed by regular containers restart.

06-27 15:07:33.004    14    14 I adb     : auth.cpp:416 adb_auth_init...
06-27 15:07:33.004    14    14 I adb     : auth.cpp:152 loaded new key from '/root/.android/adbkey' with fingerprint 24868D008D32488A8CD2E77FDEF8B60E04C5D63B3E67A21C0E52824C391E1A85
06-27 15:07:33.004    14    14 I adb     : auth.cpp:391 adb_auth_inotify_init...
06-27 15:07:33.004    14    20 I adb     : transport.cpp:335 RF8NA0WLGFD: read thread spawning
06-27 15:07:33.004    14    21 I adb     : transport.cpp:307 RF8NA0WLGFD: write thread spawning
06-27 15:07:33.015    14    14 I adb     : transport.cpp:1727 fetching keys for transport RF...FD
06-27 15:07:33.015    14    14 I adb     : auth.cpp:468 Calling send_auth_response
06-27 15:07:33.027    14    14 I adb     : auth.cpp:435 Calling send_auth_publickey
[27/06/2024 15:07:36] [INFO] --------------
[27/06/2024 15:07:36] [INFO] state: error: device unauthorized.
This adb server's $ADB_VENDOR_KEYS is not set
Try 'adb kill-server' if that seems wrong.
Otherwise check for a confirmation dialog on your device.
[27/06/2024 15:07:36] [WARN] Authorize device manually!
[27/06/2024 15:07:36] [WARN] Device is not ready.

@azarouski, let's experiment with really unauthorized device, maybe we can find any difference to define better strategy and don't limit restart when we definitely knows it will recover the device.

azarouski commented 2 months ago

On some devices with this problem, the following notification was noticed:

Screenshot 2024-06-28 at 13 07 33