johna-xceleration commented on issue #31978:
URL: https://github.com/apache/superset/issues/31978#issuecomment-2619927885

   We've recently started experiencing Gunicorn worker crashes when loading 
dashboards with charts that serve data via DuckDB. This issue began in the past 
couple of weeks, coinciding with updates to `duckdb-engine`. Through testing, I 
determined that the issue was introduced in version `0.14.2` with [this 
change](https://github.com/Mause/duckdb_engine/commit/6dbadf1edfe6fd6f0c698b6dc12debb654dde8bc).
 Pinning `duckdb-engine` to version `0.14.1` (e.g., `duckdb-engine==0.14.1`) 
resolves the problem for us.
   
   The crash seems to stem from the following code, specifically the 
`duckdb.execute()` call:
   
   ```python
           self.reserved_words.update(
               {
                   keyword_name
                   for (keyword_name,) in duckdb.execute(
                       "select keyword_name from duckdb_keywords() where 
keyword_category == 'reserved'"
                   ).fetchall()
               }
           )
   ```
   
   Although I’m not highly proficient in Python, I suspect the issue is related 
to concurrency and the direct use of `duckdb.execute()` on the module. When I 
modify the code to use `duckdb.cursor().execute()` instead, the dashboards load 
as expected.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to