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
I noticed in db.py, there are conditional imports that are controlled by global variables and locks which may lead to race conditions. This may happen as threads enter locked sections and do not have the information on whether the necessary module is already imported by another unless it is reflected by the globals. If the checking of these globals is for some reason bypassed, two threads may end up importing the same module twice, leading to unnecessary operations. This could be avoided by importing these modules at the start of the program and global variables should not be modified unless the modification is handled through a thread-safe mechanism such as thread-local storage.
The text was updated successfully, but these errors were encountered:
I appreciate your insight into the implementation of the module. Initially, I did consider that there might be issues with how I handled imports, but due to time constraints, So, I just went with what seemed like a quick fix. If you have suggestions for improvement, I'd be glad to hear them. However, at the moment, I'm tied up with other commitments. Feel free to submit a pull request with any enhancements you think would benefit the project. Thanks for your understanding.
Thank you for your response. I would very much like to submit a pull request, but I do have the necessary permissions to push to the repo. Could you grant me collaborator access?
I noticed in db.py, there are conditional imports that are controlled by global variables and locks which may lead to race conditions. This may happen as threads enter locked sections and do not have the information on whether the necessary module is already imported by another unless it is reflected by the globals. If the checking of these globals is for some reason bypassed, two threads may end up importing the same module twice, leading to unnecessary operations. This could be avoided by importing these modules at the start of the program and global variables should not be modified unless the modification is handled through a thread-safe mechanism such as thread-local storage.
The text was updated successfully, but these errors were encountered: