fastapi-utils
fastapi-utils copied to clipboard
question about race condition
https://github.com/dmontagu/fastapi-utils/blob/af95ff4a8195caaa9edaa3dbd5b6eeb09691d9c7/fastapi_utils/session.py#L33
hi , if two thread call the cached_engine , and one stoped in line 39 then yeild , and another thread start running and the engine is still none ,then both these two thread will call get_new_engine ,but there must be an engine will be overwrite by another .
may this can happend ?