Forums

IOError: write error, RuntimeError: generator ignored GeneratorExit

I often get this error on my web server log.

IOError: write error RuntimeError: generator ignored GeneratorExit

Would you have any idea where it comes from?

hmm. looking at your error log, the latest error was from Feb 15- so nothing recent- maybe you just keep seing the same error from Feb 15?

Looking at your server logs, there was a server restart then. So that's probably it.

You're not looking at the right log, last one was today. It's for my second webapp, which is actually the same as the first one but with a different URL (redirection). But yes maybe this is only due to server restart, I'll check that.

oh- one possibility is if your webapp starts consuming many gigabytes of RAM and seems like something out of control happened (eg: if you try to save something that is 2MB but instead get the units wrong and you try to create and save a 2TB file), then your webapp process might get killed, leading to the restart.

If there is a particular url/request that this happens for, then definitely double check how you are generating the response.

Otherwise, we do routinely restart web servers etc so it should be no big deal.

Oh. My wise colleagues have informed me that the generator exit comes from someone loading your webpage, and then either hitting stop or clicking on a link or otherwise navigating away before your webpage is fully loaded.

So this should be completely fine if you get it intermittently, but again, if you are getting it consistently for a specific url, then maybe all or parts of your response is really slow and you should double check that.

Yes, that seems consistent with what's in the server log for the same time. Thanks for your support.