You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TL;DR: file_uploader uses Threading.Lock - is issue specifically thread safety or simultaneous execution?
In investigating #348, I looked at determine_upload_type() which uses a Threading.Lock to protect a critical section. I added the logging statements seen here:
as the lock does not seem to prevent parallel execution from two browser tabs (Date and HH:MM removed, leaving seconds):
:12,955] INFO in file_uploader: Acquiring lock for Salesforce_PAWS Donation (all Time) (excel).xlsx >>>>>>>>>>>>>>>>>>>>>>>>>>>
:12,955] INFO in file_uploader: Got lock for Salesforce_PAWS Donation (all Time) (excel).xlsx <<<<<<<<<<<<<<<<<<<<<<<<<<<<<
:12,956] INFO in file_uploader: -File: Salesforce_PAWS_Donation_all_Time_excel.xlsx Matches files type: salesforcedonations
:14,119] INFO in file_uploader: Start uploading file: shelterluv_people.csv
:14,501] INFO in file_uploader: Acquiring lock for shelterluv_people.csv >>>>>>>>>>>>>>>>>>>>>>>>>>>
:14,501] INFO in file_uploader: Got lock for shelterluv_people.csv <<<<<<<<<<<<<<<<<<<<<<<<<<<<<
:15,384] INFO in file_uploader: -Uploaded successfully as : shelterluvpeople-2021-06-03--23-49-14.csv
:15,384] INFO in file_uploader: Releasing lock for shelterluv_people.csv >>>>>>>>>>>>>>>>>>>>>>>>>>>
:20,109] INFO in file_uploader: -Uploaded successfully as : salesforcedonations-2021-06-03--23-49-12.xlsx
:20,110] INFO in file_uploader: Releasing lock for Salesforce_PAWS Donation (all Time) (excel).xlsx >>>>>>>>>>>>>>>>>>>>>>>>>>>
I think this is because uWSGI is handling requests on a per-process basis:
Uh oh!
There was an error while loading. Please reload this page.
TL;DR: file_uploader uses Threading.Lock - is issue specifically thread safety or simultaneous execution?
In investigating #348, I looked at
determine_upload_type()
which uses a Threading.Lock to protect a critical section. I added the logging statements seen here:as the lock does not seem to prevent parallel execution from two browser tabs (Date and HH:MM removed, leaving seconds):
I think this is because uWSGI is handling requests on a per-process basis:
Does it matter? If everything works properly, it may not matter. Is there a danger if both users are uploading the same file?
If we need to synchronize across processes, we could use the db.
The text was updated successfully, but these errors were encountered: