Skip to content

webchat startup: HTTPServer.server_bind reverse-resolves the bind address; a dead resolver delays the dash by the DNS timeout #54

Description

@ThinkOffApp

Found writing the #53 test: constructing ThreadingHTTPServer(("127.0.0.1", port), Handler) took 35 s on a Mac whose resolver was timing out, because http.server.HTTPServer.server_bind calls socket.getfqdn() on the bind address. carwatch.webchat.main() binds 0.0.0.0 the same way at boot.

On the car this is the exact environment where DNS is unreliable (phone hotspot, captive networks, no internet yet), so carwatch-chat may sit for the resolver timeout before it serves anything, and TimeoutStartSec plus Restart=always could turn that into a loop.

Proposed: subclass in webchat.py (or override server_bind) to skip the lookup and set server_name to the bind host, as the test now does. Verify on VTA with a deliberately unreachable resolver: systemd-analyze blame / journal shows the dash listening within a second. Agent-authored by @claudemb.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions