Issues resolving and connecting to 'external' services.

Lookups from the Fly app to the DB server didn’t seem to work.

What do you see when you flyctl ssh -a <appname> and exec

# query goog for an ip4 record
nslookup -debug -type A <my.db.host.tld> 8.8.8.8

# query fly dns-stub resolver for an ip4 record
nslookup -debug -type A <my.db.host.tld> fdaa::3


If I then re-try after, say, overnight - I get connection issues:
write tcp 172.19.5.90:53500->[external IP]:9440: write: connection timed out

Without looking at the code, I can only speculate that the db connection pooler might be at fault. If you’re in the JDK land, c3po is rock solid. Note though, distributed-by-default databases like Aurora and PlanetScale may require special handling for pooled conns; generic connection poolers like c3po might not cut it. Better to connect to those databases via their HTTP front-ends, than over odbc / what-have-you.

I’m not aware of the keepalive semantics for (outgoing) conns originating in fly apps. May be fly engs can chime in to clarify that bit. What I do know is, incoming TCP conns are terminated by the fly load balancer, if idle for more than 60s: Increasing idle timeout.