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

[FIX] runbot: warn when a local pg backend cannot be terminated #733

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from

Conversation

d-fence
Copy link
Contributor

@d-fence d-fence commented Feb 9, 2023

For whatever reason, it happens that we open a testing database in a psql console as another user. In that case, the runbot is unable to terminate the backend and goes in an error loop.

For whatever reason, it happens that we open a testing database in a
psql console as another user. In that case, the runbot is unable to
terminate the backend and goes in an error loop.
try:
query = 'SELECT pg_terminate_backend({}) FROM pg_stat_activity WHERE datname=%s'.format(pid_col)
except InsufficientPrivilege:
_logger.warning('Cannot terminate backend process for %s (maybe a root psql console is accessing the database).', dbname)
Copy link
Contributor

Choose a reason for hiding this comment

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

We could maybe add a runbot warning? this could be like that for a while.
I'm also worried because it could wait for a while an slow down the loop. Not sure
We could add a mechanism like pull_info_failures to avoid spamming the log and avoid useless retry. Just keeping a list of failed database in memory maybe

@Xavier-Do Xavier-Do changed the base branch from 15.0 to 16.0 June 22, 2023 13:53
@C3POdoo C3POdoo requested a review from a team June 22, 2023 14:11
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.

2 participants