def db_setup_with_retry(
    db_name,
    db_host,
    db_port,
    username=None,
    password=None,
    ensure_indexes=True,
    tls=False,
    tls_certificate_key_file=None,
    tls_certificate_key_file_password=None,
    tls_allow_invalid_certificates=None,
    tls_ca_file=None,
    tls_allow_invalid_hostnames=None,
    ssl_cert_reqs=None,  # deprecated
    authentication_mechanism=None,
    ssl_match_hostname=True,  # deprecated
):
    """
    This method is a retry version of db_setup.
    """
    return db_func_with_retry(
        db_setup,
        db_name,
        db_host,
        db_port,
        username=username,
        password=password,
        ensure_indexes=ensure_indexes,
        tls=tls,
        tls_certificate_key_file=tls_certificate_key_file,
        tls_certificate_key_file_password=tls_certificate_key_file_password,
        tls_allow_invalid_certificates=tls_allow_invalid_certificates,
        tls_ca_file=tls_ca_file,
        tls_allow_invalid_hostnames=tls_allow_invalid_hostnames,
        ssl_cert_reqs=ssl_cert_reqs,  # deprecated
        authentication_mechanism=authentication_mechanism,
        ssl_match_hostname=ssl_match_hostname,  # deprecated
    )

    This method is a retry version of db_setup.
    
st2common/st2common/persistence/db_init.py