openapi-python-sdk icon indicating copy to clipboard operation
openapi-python-sdk copied to clipboard

Thread safety issues when sharing OauthClient in Celery workers

Open francescobianco opened this issue 8 months ago • 0 comments

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.


francescobianco avatar Mar 18 '26 14:03 francescobianco