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

Fixed server getting stuck on deleted files #2738

Merged
merged 1 commit into from Apr 4, 2024

Conversation

RunDevelopment
Copy link
Member

Fixes #2679

The cause of this bug is absolutely stupid. The issue is that passing an exception as the second positional argument to logger.debug/info/warn/error will cause the messages to be formatted with it. Sanic essentially does message.format(args) behind the scenes, so the intended usage is logger.error("My name is %s!", name). (We never use this because f-strings exist.) The problem is that formatting will fail if any positional argument goes unused. (Yes, it's great API design when something as important as logging can trivially fail...) For whatever reason, if you fail to format 3 times, the thread you log in will get stuck and never respond to anything again.

The fix for now is to fix the formatting by not using it. The long term fix is to switch to a competent logger.


Btw, I also check for other instances of positional arguments being used: there were none.

Copy link
Member

@joeyballentine joeyballentine left a comment

Choose a reason for hiding this comment

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

What the fuck

@joeyballentine joeyballentine merged commit 75f70c4 into chaiNNer-org:main Apr 4, 2024
14 checks passed
@RunDevelopment RunDevelopment deleted the fix-stuck branch April 4, 2024 15:06
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.

Deleting loaded images causes infinite loading
2 participants