-
Notifications
You must be signed in to change notification settings - Fork 117
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
SNOW-1418543 make local testing thread safe #2185
SNOW-1418543 make local testing thread safe #2185
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you've hit all the places that I would expect to have a lock. I'm not a fan of the analyzer.session._conn._lock
syntax used in a few places. Maybe have connections expose there lock so you don't have to access a private variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great job, thanks for updating the local testing part
Which Jira issue is this PR addressing? Make sure that there is an accompanying issue to your PR.
Fixes SNOW-1418543
Fill out the following pre-review checklist:
Please describe how your code solves the related issue.
Note: For easy reviewing, enable
hide whitespace
when viewing the gitdiff.This PR adds locks to connection, oob_telemetry and MockFunctionRegistry to ensure updates to local testing objects are thread-safe. A list of updates that are now protected are
_connection.py
:MockServerConnection
_get_client_side_session_parameter
,_get_current_parameter
close
TabularEntityRegistry
read_view_if_exists
andread_table_if_exists
to atomically read table/view if they exist_functions.py
:MockedFunctionRegistry
_plan.py
execute_mock_plan
handle_udf_expression
: udf and imports are read atomicallyhandle_function_expression
_stage_registry.py
StageEntityRegistry
StageEntity
class is not updated_stored_procedure.py
and_udf.py
_telemetry.py
add
,flush
andexport_queue_to_string
are lock protectedsession.py
_active_schema
,_active_database
are lock protected