cloudera / hue

Open source SQL Query Assistant service for Databases/Warehouses
https://cloudera.com
Apache License 2.0
1.18k stars 370 forks source link

"Results have expired, rerun the query if needed" #3164

Open jerryleooo opened 1 year ago

jerryleooo commented 1 year ago

Describe the bug:

Global variables are not shared between different gunicorn workers. https://github.com/cloudera/hue/blob/b5d126ea651d76e982a13c7da3661dac9a939246/desktop/libs/notebook/src/notebook/connectors/sql_alchemy.py#L90

Steps to reproduce it?

  1. Use the docker-compose to up the service, with following configurations:
    gunicorn_work_class=eventlet
    gunicorn_number_of_workers=8
  2. configure an interpreter with Athena/Trino/Presto + sqlalchemy
  3. use 2 different browser tabs to submit queries in editor, and you may see the Results have expired, rerun the query if needed. error

Hue version or source?

open source 4.10.0

sbbagal13 commented 1 year ago

I too observed similar issue with Trino

bjornalm commented 1 year ago

Hi @jerryleooo, thanks for reporting this. Do you know if this happens with other interpreters as well?

@Harshg999 can you have a look?

jerryleooo commented 1 year ago

Hi @bjornalm I haven't tried other interpreters, later i may try jdbc and update here

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity and is not labeled "Prevent stale". Remove "stale" label or comment or this will be closed in 10 days.

sbbagal13 commented 1 year ago

Is it resolved in recent release or do we need to change the interpreter for this ? CC: @bjornalm @Harshg999

vpattar commented 1 year ago

I too observed similar issue with Trino, which is connected through a VPC endpoint.

Is there a known workaround to this?

jerryleooo commented 1 year ago

@vpattar now I use gunicorn_work_class=sync and gunicorn_number_of_workers=1, and running 3 instances behind a LB

Harshg999 commented 1 year ago

With Gunicorn now, we need to relook and scope how to share global variable state. I've created an internal roadmap item for this issue and will take it up for subsequent releases. Thanks for flagging this @jerryleooo.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity and is not labeled "Prevent stale". Remove "stale" label or comment or this will be closed in 10 days.

hackeryang commented 3 months ago

I also met this error using StarRocks(compatible with mysql protocol), and when i used the mysql JDBC configuration way, it worked and returned query results. Maybe the sqlalchemy way has some session or connection bugs.

You can also try the JDBC way(need to upload JDK and execute $HUE_HOME/build/env/bin/pip install py4j ahead): https://docs.gethue.com/administrator/configuration/connectors/#mysql