#1294 prosody should fallback to ipv4 when ipv6 fails

Reporter phil
Owner Zash
Created
Updated
Stars ★ (1)
Tags
  • Priority-Medium
  • Status-WontFix
  • Type-Enhancement
  1. phil on

    Description of feature: When using prosody on dual stack server prosody should fallback to ipv4 when ipv6 fails. In my case, connecting to one of my s2s' ipv6 address leads to a connection timeout due to routing problems. Prosody cancels' the connection attempt with: Disconnecting mydomain.example[s2sout_unauthed], <stream:error> is: connection-timeout Since ipv4 works fine it'd be nice if prosody could try the server's A-RR as well.

  2. Zash on

    This is already what the code does, under certain circumstances. Notably, there is an overall s2s connection timeout defaulting to 90 seconds, after which Prosody gives up completely. If an individual TCP connection times out before that, then Prosody will try another SRV target. The problem is that with Linux default settings, this takes slightly more than 90 seconds, so it gives up and never tries the next IP. What network backend are you using? (network_backend = ? or use_libevent = ?)

  3. phil on

    I'm using the default one ("select"). Thanks for the hint, I'll try other network backends.

  4. Zash on

    server_event (using libevent) had a timeout on initial connections set to 20s in 2010 in https://hg.prosody.im/trunk/rev/9fab59009397 (up from 10s) server_epoll also has this set to 20s now since https://hg.prosody.im/trunk/rev/729de68f0068 so only server_select remains without this, so it would run into the >90s Linux TCP timeout. server_select is headed towards deprecation, so I don't think it is worth it to fix. The Linux TCP timeout can be changed system-wide using the 'net.ipv4.tcp_syn_retries' sysctl. This seems beneficial for an instant messaging server, not so sure what effect it has on other things. in trunk (to be 0.12) there is also work towards implementing happy eyeballs, which would solve this issue regardless of server backend timeouts. Closing because it already does fallback, if it doesn't run into that s2s timeout first.

    Changes
    • owner Zash
    • tags Status-WontFix

New comment

Not published. Used for spam prevention and optional update notifications.