Open yacchin1205 opened 1 month ago
The BaseFileNode is supposed to be created by get_or_create, but this process may create several BaseFileNodes with the same parameters if they are accessed concurrently.
To avoid creating duplicate objects, it is necessary to add a UNIQUE constraint. In the past, there was a UNIQUE INDEX for BaseFileNode, but it is not found in the current code...
I am also aware that some Storage Providers may have files that can have the same name... For example, Dataverse https://github.com/CenterForOpenScience/osf.io/pull/9959 Similarly, it should be considered that Google Drive can have different file nodes with the same name. https://github.com/CenterForOpenScience/osf.io/pull/8835 <= Is this Pull Request not reflected?
I will attempt to fix it... So, what should be the approach to attempting to fix it?
Accessing a Google Drive folder via the API at the same time may cause it to only return a 502 Bad Gateway afterwards.
Reproduction steps:
MultipleObjectTest
) under Google Drive.After a few runs, it only returns a 502 Bad Gateway.
From that point afterwards, a 502 Bad Gateway will be returned for a single request.
When I tried the same test for a container launched by docker-compose as a development environment, the following logs were output.
It appears that multiple BaseFileNodes have been created, which would normally be expected to be one for a path.