Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing threadsafety as we already lock connections behind threads #897

Merged
merged 4 commits into from
Sep 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions .github/workflows/cypress-end-to-end-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ jobs:
uses: actions/setup-python@v2

- name: 🪨 Setup Node
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 16.16.0

- name: 🤖 Install Mephisto
run: pip install -e .
Expand Down Expand Up @@ -116,9 +116,9 @@ jobs:
uses: actions/setup-python@v2

- name: 🪨 Setup Node
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 16.16.0

- name: 🤖 Install Mephisto
run: pip install -e .
Expand Down Expand Up @@ -161,9 +161,9 @@ jobs:
uses: actions/setup-python@v2

- name: 🪨 Setup Node
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 16.16.0

- name: 🤖 Install Mephisto
run: pip install -e .
Expand Down Expand Up @@ -205,9 +205,9 @@ jobs:
uses: actions/setup-python@v2

- name: 🪨 Setup Node
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 16.16.0

- name: 🤖 Install Mephisto
run: |
Expand Down Expand Up @@ -251,9 +251,9 @@ jobs:
uses: actions/setup-python@v2

- name: 🪨 Setup Node
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 16.16.0

- name: 🤖 Install Mephisto
run: pip install -e .
Expand Down Expand Up @@ -295,9 +295,9 @@ jobs:
uses: actions/setup-python@v2

- name: 🪨 Setup Node
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 16.16.0

- name: 🤖 Install Mephisto
run: |
Expand Down
2 changes: 1 addition & 1 deletion mephisto/abstractions/databases/local_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def _get_connection(self) -> Connection:
curr_thread = threading.get_ident()
if curr_thread not in self.conn or self.conn[curr_thread] is None:
try:
conn = sqlite3.connect(self.db_path)
conn = sqlite3.connect(self.db_path, check_same_thread=False)
conn.row_factory = StringIDRow
self.conn[curr_thread] = conn
except sqlite3.Error as e:
Expand Down
2 changes: 1 addition & 1 deletion mephisto/abstractions/providers/mock/mock_datastore.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def _get_connection(self) -> sqlite3.Connection:
"""
curr_thread = threading.get_ident()
if curr_thread not in self.conn or self.conn[curr_thread] is None:
conn = sqlite3.connect(self.db_path)
conn = sqlite3.connect(self.db_path, check_same_thread=False)
conn.row_factory = sqlite3.Row
self.conn[curr_thread] = conn
return self.conn[curr_thread]
Expand Down
2 changes: 1 addition & 1 deletion mephisto/abstractions/providers/mturk/mturk_datastore.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def _get_connection(self) -> sqlite3.Connection:
"""
curr_thread = threading.get_ident()
if curr_thread not in self.conn or self.conn[curr_thread] is None:
conn = sqlite3.connect(self.db_path)
conn = sqlite3.connect(self.db_path, check_same_thread=False)
conn.row_factory = sqlite3.Row
self.conn[curr_thread] = conn
return self.conn[curr_thread]
Expand Down