Monkey-patch retry_on_connection_failure from 2.7.1