SSH connections aren't properly cleaned up when file downloads fail. After multiple failed downloads, this can exhaust the connection limit on whale tags, making them unreachable until connections timeout or the tag is restarted.
Root cause: Connection variables are created inside try blocks but cleaned up in finally blocks without null checks, causing cleanup to fail when errors occur during connection setup.
Location: ceti/whaletag.py - download_remote_file() and similar functions
Fix: Initialize connection variables to None before try blocks and check existence before closing in finally blocks.
SSH connections aren't properly cleaned up when file downloads fail. After multiple failed downloads, this can exhaust the connection limit on whale tags, making them unreachable until connections timeout or the tag is restarted.
Root cause: Connection variables are created inside try blocks but cleaned up in finally blocks without null checks, causing cleanup to fail when errors occur during connection setup.
Location:
ceti/whaletag.py-download_remote_file()and similar functionsFix: Initialize connection variables to
Nonebefore try blocks and check existence before closing in finally blocks.