Skip to content

SSH connection leak when downloads fail #41

@claymore666

Description

@claymore666

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions