Summary
I’m using a statement_timeout
to prevent long running queries, but the query
method retries the query 3 times.
Steps to reproduce
Code snippet:
self.conn = st.experimental_connection("db", type="sql", url=db_url)
with self.conn.session as session:
session.execute(text("SET statement_timeout = '5s';"))
session.commit()
self.conn.query("select pg_sleep(10);")
If applicable, please provide the steps we should take to reproduce the error or specified behavior.
Expected behavior:
The query is not retried.
Actual behavior:
The query is retried 3 times.
Debug info
- Streamlit version: 1.22.0
- Python version: (3.11.3)
Links
The retry is done by this code: streamlit/sql_connection.py at 9a6ce804b7977bdc1f18906d1672c45f9a9b3398 · streamlit/streamlit · GitHub
I tried changing the retry options but they are in the protected method