Skip to content

Streamlit app runs into an error after some time when deployed as Databricks appΒ #16

@alxy

Description

@alxy

I have deployed the Streamlit sample app as Databricks app to my workspace. The app was working fine for a couple of days. However, after some time I got the following error when interacting with delta tables (I slightly plaxed with the layout of that app, but the code is taken directly from the sample):

Image

I wasn't able to find the root cause of the error, but I had to re-deploy my app (again, using exactly the same code) and it started to work again as expected. My assumption is (I dont know how I can proof it) that is may be related to connection resource caching - as other people have also faced issues with long-open sql connections: databricks/databricks-sql-python#23 (comment)

As an additional info: I'm using a serverless SQL warehouse with auto-shutdown of 10 minutes. Not sure if this plays will with a longer idle time on the app and the connection caching.

Code in question is here:

@st.cache_resource
def get_connection(http_path):
return sql.connect(
server_hostname=cfg.host,
http_path=http_path,
credentials_provider=lambda: cfg.authenticate,
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions