Skip to content

Thread safety issues when sharing OauthClient in Celery workers #4

@francescobianco

Description

@francescobianco

Thread safety issues when sharing OauthClient in Celery workers

Description
Using a shared OauthClient across Celery workers leads to inconsistent results.

Code snippet

from celery import shared_task
from openapi_sdk import OauthClient

oauth_client = OauthClient("user", "apikey", test=True)

@shared_task
def fetch_token():
    return oauth_client.create_token(["scope"], 3600)

Observed behavior
Random failures or corrupted responses.


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