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

Exclude internetarchive's internal logging from Discord #346

Merged
merged 1 commit into from
Oct 19, 2024

Conversation

HebaruSan
Copy link
Member

Problem

After #345, the archive.org-related Discord log spam is reduced to one of these every 5 minutes:

(MaxRetryError("HTTPSConnectionPool(host='s3.us.archive.org', port=443): Max retries exceeded with url: /?check_limit=1&accesskey=<KEY PRUNED> (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7fcb3cf37560>, 'Connection to s3.us.archive.org timed out. (connect timeout=12)'))"), 'https://s3.us.archive.org/?check_limit=1&accesskey=<KEY PRUNED>')

Cause

The Mirrorer is (appropriately) checking whether archive.org is overloaded here, which returns True:

if self.ia_session.s3_is_overloaded(access_key=self.ia_access):

We don't log that message; internetarchive itself does, specifically here:

https://github.com/jjjake/internetarchive/blob/c578552d0c532f513b6e972b9f5529584b04c254/internetarchive/session.py#L539

This shouldn't be forwarded to Discord.

Changes

Now DiscordLogHandler's constructor accepts a regex to evaluate against each log record's logger name, which we pass as a zero-width negative lookahead assertion to exclude loggers containing internetarchive.

@HebaruSan HebaruSan added the Mirrorer Uploads mods to archive.org label Oct 19, 2024
@HebaruSan HebaruSan merged commit 6b9e530 into KSP-CKAN:master Oct 19, 2024
3 checks passed
@HebaruSan HebaruSan deleted the fix/ia-logging branch October 19, 2024 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Mirrorer Uploads mods to archive.org
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant