libsoup Ignores DNS TTLs in load-balanced architecture AWS Elastic Load Balancer

94 Views Asked by At

according to this link http://www.chaseventers.org/2010/09/libsoup-ignores-dns-ttls.html

The code from libsoup /* Requires host_lock to be locked */

static SoupSessionHost *
get_host_for_uri (SoupSession *session, SoupURI *uri)
{
    SoupSessionPrivate *priv = SOUP_SESSION_GET_PRIVATE (session);
    SoupSessionHost *host;

    host = g_hash_table_lookup (priv->hosts, uri);
    if (host)
        return host;

    host = soup_session_host_new (session, uri);
    g_hash_table_insert (priv->hosts, host->uri, host);

    return host;
}

Unfortunately, entries in this hash table are never removed or expired unless the SoupSession object itself goes away.

This sucks for a few reasons:

  1. DNS TTL values are ignored. Instead, the result of the DNS query is cached forever. Obviously this means that if the record is ever changed, libsoup clients need to be restarted to know about it.

  2. DNS load balancing is broken by libsoup, which will repeatedly connect to the same IP address regardless of whether multiple IPs are included in the response to an A query.

So it looks like libsoup would behave nasty in load balancing aws cloud environment. please confirm.

1

There are 1 best solutions below

1
On

You can migrate to Network Load Balancer which provides a static IP address instead of a DNS name that resolves to different IP's per AZ, so even though the library does not respect TTL's, it won't be a problem for you.