fastapi-utils icon indicating copy to clipboard operation
fastapi-utils copied to clipboard

question about race condition

Open rmGFW opened this issue 4 years ago • 0 comments

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 ?

rmGFW avatar Nov 25 '21 14:11 rmGFW