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

feat: tune timeouts and add logging to table trigger setup process #252

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

saikonen
Copy link
Collaborator

@saikonen saikonen commented Oct 27, 2021

Add logging for when trigger setup is skipped, and when it fails.

Sets up server-side statement_timeout for DBConfiguration as part of the connection pool for the ui_backend. default is kept as None in case timeouting behavior is not wanted for metadata service.

  • Test that PR introduces no unwanted timeout behavior to metadata service
  • Check that UI Backend correctly handles the new possible errors asyncio.CancelledError and asyncio.TimeoutError

…lt timeout for trigger setup and log warning upon timeout.
@saikonen
Copy link
Collaborator Author

Still a work in progress due to items on the TODO.

@@ -366,6 +368,8 @@ async def create_if_missing(db: _AsyncPostgresDB, table_name, command):
@staticmethod
async def create_trigger_if_missing(db: _AsyncPostgresDB, table_name, trigger_name, commands=[]):
"executes the commands only if a trigger with the given name does not already exist on the table"
# NOTE: keep a relatively low timeout for the setup queries,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How would we set the timeout here differently than the other statements. I agree that these should have a very quick timeout and others can potentially be longer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants