-
Notifications
You must be signed in to change notification settings - Fork 13.4k
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
Asynchronous query execution sometimes stuck in PENDING status #29401
Comments
To resolve the issue where asynchronous (ASYNC) queries are getting stuck in the PENDING status, ensure the following:
Ensure that the Celery broker and backend configurations are correct and that the workers can communicate with the main application [1][2][3]. |
Yes, configured as below:
|
Your configuration for Redis caching and Celery workers looks correct. Here are a few additional steps to ensure everything is set up properly:
By following these steps, you should be able to identify and resolve the issue causing asynchronous queries to get stuck in the PENDING status. |
@Habeeb556 just curious what wound up working, but glad it's resolved! :D |
@rusackas, I forgot to restart the service after upgrading the configurations. ^^ |
@dosu I encountered this error with a pending status in Celery.
|
To resolve the timeout error when trying to fetch the latest geckodriver release from GitHub, you can increase the timeout duration for the Here is the modified section of the Dockerfile: # Install GeckoDriver WebDriver
ARG GECKODRIVER_VERSION=v0.34.0 \
FIREFOX_VERSION=125.0.3
RUN apt-get update -qq \
&& apt-get install -yqq --no-install-recommends wget bzip2 \
&& wget --timeout=60 -q https://github.com/mozilla/geckodriver/releases/download/${GECKODRIVER_VERSION}/geckodriver-${GECKODRIVER_VERSION}-linux64.tar.gz -O - | tar xfz - -C /usr/local/bin \
# Install Firefox
&& wget --timeout=60 -q https://download-installer.cdn.mozilla.net/pub/firefox/releases/${FIREFOX_VERSION}/linux-x86_64/en-US/firefox-${FIREFOX_VERSION}.tar.bz2 -O - | tar xfj - -C /opt \
&& ln -s /opt/firefox/firefox /usr/local/bin/firefox \
&& apt-get autoremove -yqq --purge wget bzip2 && rm -rf /var/[log,tmp]/* /tmp/* /var/lib/apt/lists/* This sets the timeout for |
@dosu I am not using a docker |
To resolve the timeout issue when trying to fetch the latest geckodriver release from GitHub using Celery, you can try increasing the timeout settings in your Celery configuration. Specifically, you can adjust the Here is an example configuration: SCREENSHOT_LOCATE_WAIT = 200 # Increase the wait time for locating elements
SCREENSHOT_LOAD_WAIT = 1200 # Increase the wait time for loading the page These settings will give more time for the geckodriver to fetch and load the necessary resources, potentially resolving the timeout issue [1]. |
@dosu still the same issue with the below
|
++ @dosu find the below also
|
To resolve the issue with Selenium Manager failing to obtain the geckodriver, you can manually download and install the geckodriver and ensure that it is accessible in your system's PATH. Here are the steps:
By manually installing the geckodriver and ensuring it is in your PATH, you should be able to avoid the timeout issue with Selenium Manager and successfully generate thumbnails using Celery in Superset [1]. |
@dosu how to resolve this issue cache in celery:
|
To resolve the caching issue in Celery, ensure that your Redis configuration is correctly set up in import os
REDIS_HOST = os.getenv("REDIS_HOST", "localhost")
REDIS_PORT = os.getenv("REDIS_PORT", "6379")
REDIS_CELERY_DB = os.getenv("REDIS_CELERY_DB", "0")
REDIS_RESULTS_DB = os.getenv("REDIS_RESULTS_DB", "1")
REDIS_CACHE_DB = os.getenv("REDIS_CACHE_DB", "4")
CACHE_CONFIG = {
"CACHE_TYPE": "RedisCache",
"CACHE_DEFAULT_TIMEOUT": 300,
"CACHE_KEY_PREFIX": "superset_",
"CACHE_REDIS_URL": f"redis://{REDIS_HOST}:{REDIS_PORT}/{REDIS_CACHE_DB}",
}
DATA_CACHE_CONFIG = CACHE_CONFIG
class CeleryConfig:
broker_url = f"redis://{REDIS_HOST}:{REDIS_PORT}/{REDIS_CELERY_DB}"
imports = ("superset.sql_lab", "superset.tasks.thumbnails")
result_backend = f"redis://{REDIS_HOST}:{REDIS_PORT}/{REDIS_RESULTS_DB}"
worker_prefetch_multiplier = 1
task_acks_late = False
beat_schedule = {
"reports.scheduler": {
"task": "reports.scheduler",
"schedule": crontab(minute="*", hour="*"),
},
"reports.prune_log": {
"task": "reports.prune_log",
"schedule": crontab(minute=10, hour=0),
},
}
CELERY_CONFIG = CeleryConfig Ensure that the environment variables Additionally, make sure you have the necessary dependencies installed for Redis caching: pip install redis If the issue persists, check the Celery worker logs for any specific error messages related to caching. These logs can provide more details about the problem [3]. |
NICE! RESOLVED
|
@dosu I got this error in log
|
To resolve the You can set the environment variable import os
from selenium import webdriver
# Set the environment variable for geckodriver log path
os.environ['GECKODRIVER_LOG'] = '/path/to/logs/geckodriver.log'
options = webdriver.FirefoxOptions()
options.headless = True # Run in headless mode if needed
driver = webdriver.Firefox(executable_path='/usr/local/bin/geckodriver', options=options) Make sure to replace |
Resolved with this:
But still have issue with this error in Celery log:
|
Bug description
I encountered the following issue: all ASYNC queries are PENDING.
The log shows that the queries are passed to the workers but do not return.
How to reproduce the bug
Allow using Asynchronous query execution in database. When there a heavy load the queries get stuck in PENDING status.
Screenshots/recordings
Superset version
4.0.1
Python version
3.11
Node version
I don't know
Browser
Chrome
Additional context
No response
Checklist
The text was updated successfully, but these errors were encountered: