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

Threaded-logger option causes [Errno 90 message too long] #1093

Open
brianjsw opened this issue Oct 31, 2015 · 6 comments
Open

Threaded-logger option causes [Errno 90 message too long] #1093

brianjsw opened this issue Oct 31, 2015 · 6 comments

Comments

@brianjsw
Copy link

I noticed that when I use the threaded-logger option that if a badly behaved third party python package just so happens to decide to print more than 212,960 bytes to stdout that uWSGI generates an Error 90 "message too long" exception and this terminates execution of the thread. Notwithstanding the fact that this third party package should not be "printing" because it's being hosted in uWSGI, I would think we would still want to avoid crashing just because an app decides to "print a long string". Some sites suggest routing Django logging to the console using the StreamHandler, and in that case this same issue will also affect anybody who makes the dubiously poor decision of trying to log a message that long.

To reproduce this, simply put:

threaded-logger = True

And in your wsgi.py put:

print 212961 * 'T' at the end of the file.

@xrmx
Copy link
Collaborator

xrmx commented Nov 3, 2015

Are you sure this is uwsgi failing to write to the logfile and not django writing to syslog maybe?

@brianjsw
Copy link
Author

brianjsw commented Nov 6, 2015

Actually I believe the problem has nothing to do with the logfile plugin. Rather the problem manifests only when the threaded-logger option is turned on.

@brianjsw brianjsw changed the title logfile plugin generates [Errno 90 message too long] Threaded-logger option causes [Errno 90 message too long] Nov 6, 2015
@brianjsw
Copy link
Author

brianjsw commented Nov 6, 2015

I removed anything related to logfile and syslog yet still had the problem. It wasn't until five hours later I noticed that I had turned on threaded-logger. I don't know why but for some reason the error vanished when I turned the threaded logger off.

@xrmx
Copy link
Collaborator

xrmx commented Nov 6, 2015

@brianjsw please don't rewrite original bug report :) Please provide a logger option config that in combination with threaded-logger make the error happen.

@brianjsw
Copy link
Author

brianjsw commented Nov 6, 2015

If you include threaded-logger=True in your config, and if you have a logto=/path/to/your/file in your config, and you use that wsgi.py file with the large print statement, that will cause the exception.

@marc1n
Copy link

marc1n commented May 8, 2020

See also issue #1265.

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

No branches or pull requests

3 participants