Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Fix client IPs being broken on Python 3 #3908

Merged
merged 11 commits into from
Sep 20, 2018
Merged

Fix client IPs being broken on Python 3 #3908

merged 11 commits into from
Sep 20, 2018

Conversation

hawkowl
Copy link
Contributor

@hawkowl hawkowl commented Sep 18, 2018

Fixes #3893

@hawkowl hawkowl requested a review from a team September 18, 2018 18:49
Copy link
Member

@erikjohnston erikjohnston left a comment

Choose a reason for hiding this comment

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

Otherwise looks good

@@ -117,7 +117,7 @@ def _do_execute(self, func, sql, *args):
sql, *args
)
except Exception as e:
logger.debug("[SQL FAIL] {%s} %s", self.name, e)
logger.error("[SQL FAIL] {%s} %s", self.name, e)
Copy link
Member

Choose a reason for hiding this comment

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

Please don't, as this can get really quite spammy iirc

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From the ticket from @richvdh :

if update_client_ips is failing, it needs to log at ERROR or above.

Do we not want to know when SQL fails?

Copy link
Member

Choose a reason for hiding this comment

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

Well we raise and handle it later. There are a bunch of failure modes that are non-error case, but instead get retried: https://github.com/matrix-org/synapse/blob/master/synapse/storage/_base.py#L249-L280

I'd really expect the exception to bubble up all the way to the client IP code, so I wonder if we're just swallowing it there?

"Couldn't drop old db: " + str(e), category=UserWarning
)
time.sleep(0.5)

Copy link
Member

Choose a reason for hiding this comment

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

Can you add quick comment why this is necessary?

)
except Exception as e:
# Failed to upsert, log and continue
logger.error("Failed to insert client IP: %r", entry)
Copy link
Member

Choose a reason for hiding this comment

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

could you log the reason for the failure (ie, e) as well as the fact it's failed?

@hawkowl hawkowl merged commit 1f3f5fc into develop Sep 20, 2018
@hawkowl hawkowl deleted the hawkowl/py3client-ip branch September 20, 2018 10:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants