Skip to content

mqtt.library: connect-phase (gethostbyname/connect) is not abortable #7

Description

@sidick

Flagged in the pre-release review, deliberately deferred (not a v0.1 blocker).

gethostbyname()/connect() in src/amiga/transport_bsdsocket.c's connect phase have no WaitSelect()/CTRL_C abortability of their own — they rely on the stack's default break mask. In mqtt.library's child process, that signal is never sent, so an MQTT_Connect() (or auto-reconnect) attempt against an unresponsive host blocks the child in connect() for the full TCP timeout (~75s+); an MQTT_DeleteClient() issued meanwhile stalls until it elapses.

Contravenes the project's "network waits stay abortable" rule (CLAUDE.md) for the connect phase specifically (the data-transfer phase already handles this correctly via WaitSelect() + SIGBREAKF_CTRL_C).

Likely fix: run connect() non-blocking and drive it through WaitSelect() like the rest of the transport, or spawn the connect attempt so it can be signalled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtech-debtDeliberately deferred fix or design tradeoff from a past review

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions