behavior of a Sql Server availability group listener and a jdbc client during a failover?

i have a question about the behavior of the AG listener during a failover… when the failover happens, I realize that all the connections on both primary and secondaries are closed.

if the client apps are using one of the blessed client libraries (such as microsoft jdbc > 6.0) they will then start immediately trying to reconnect to the ip addresses associated with the listener. But what happens during the 10 second period (or whatever it is) for the failover to complete? Might a client successfully get a connection, only to get a fatal error message when it tries to use it? Or is something done to ensure that no client will get a connection successfully during failover itself, so that that when a client does successfully get a connection, it is actually usable?

(Also, specifically for a java client using a recent microsoft jdbc driver, does it try only once per getConnection() call? Or will it keep polling until a logintimeout is hit?)

I realize i’m mixing questions about server behavior with client library behavior but I’m trying to understand the whole scenario; thanks.