Skip to content

Intermittent Dataset Retrieval Errors When Making Parallel API Requests #33828

@orlandolaycos

Description

@orlandolaycos

Bug description

Describe the bug
This issue occurs specifically with the /dataset method. It does not consistently return the correct dataset when called concurrently with Rison encoded filter looking for the "table_name".
The problem manifests about 5% of the time, indicating it may be a race condition or a resource contention issue.

To Reproduce

  1. Make multiple parallel API requests to the /dataset endpoint, each querying for different "table_name" values.
  2. Compare the returned datasets with the expected results based on the initial queries.

What I've tried:

  • When the error occurs, a subsequent call with the same query returns the correct dataset, suggesting that the issue may not be with the dataset itself but rather with how the API handles concurrent requests.
  • Serial calls (one after the other) do not produce errors, indicating that the problem is likely related to concurrency.
  • Using 'mitmweb' to monitor traffic revealed that the error originates from the Superset response.

Screenshots/recordings

N.A.

Superset version

v5.0.0rc3
v4.1.2

Python version

3.9

Node version

22

Browser

Chrome

Additional context

I'm developing an application that generates dashboards "on the fly" where each chart is basically fed by a dataset (in a 1:1 relationship). Since the dataset's table_name is a unique ID, I'm using it to retrieve the dataset through the API, giving it a fixed UUID based on the user/dashboard.

I am making approximately 12 concurrent requests to retrieve around 70 datasets, which are updated frequently.

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiRelated to the REST APIdata:datasetRelated to dataset configurations

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions