Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RemoteDisconnectError on cursor.fetchall() #29

Open
willtho89 opened this issue Nov 29, 2023 · 0 comments
Open

RemoteDisconnectError on cursor.fetchall() #29

willtho89 opened this issue Nov 29, 2023 · 0 comments

Comments

@willtho89
Copy link

Hi,

for an internal project, we need to regularly get data from caluclated insights. I wrote a simple automation to get the data on a schedule using the cursor.fetchall() method.

Unfortunately this fails roughly half the time with a RemoteDisconnectError. We expect roughly 5.000.000 rows and i suspect one of the QuerySubmitter.get_next_batch(cur.connection, cur.next_batch_id) fails and won't retry.

def query_cdp(config: CDPConfig):
    from log_helper import logger

    # init CDP cursor
    conn = SalesforceCDPConnection(
        SF_LOGIN_URL, SF_USERNAME, SF_PASSWORD, SF_CLIENT_ID, SF_CLIENT_SECRET
    )

    # Query CDP
    logger.info(f"[{config.file_name}] Run CDP query '{config.query}'")
    cur = conn.cursor()
    cur.execute(config.query)
    return cur.fetchall()

Is there any retry method built-in? Can't find one on first glance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant