Closed imgurbot12 closed 2 years ago
This is probably happening because asyncio protocols are supposed to implement pause_writing
and resume_writing
whenever underlying buffers get full but in didn't get to this.
Ok, is there any way i can fix this? Or is this a module issue?
The correct way to fix this would be implementing control flow callbacks (pause_writing
and resume_writing
) and not flushing entire buffer if it's higher than transport's high water mark.
For now what you can try doing is putting request.transport.set_write_buffer_limits(high=<a value enough to fit whole response>)
. You are gonna need to play with this value a little to find one that let's underlying transport drain data fast enough and not overflow. https://docs.python.org/3/library/asyncio-protocol.html#asyncio.WriteTransport.set_write_buffer_limits
@imgurbot12 did setting the set write buffer limit worked for you? I have put it as high as 16MB it is still trying to pause and resume the buffer.
UPDATE: The high limit according to request.transport.get_write_buffer_limits() is already 65536 by default. I actually set it lower. Still get the same behavior even when it is set higher than that.
@squeaky-pl - If you'd give me some pointers on what these methods should actually do, I wouldn't mind implementing them, Python's C API doesn't scare me anymore. (We're happily using Japronto on an internal production system, and the workaround works, but is obviously not ideal.)
I was testing a server using Japronto in an Ubuntu-14.04 64bit Virtualbox VM when i came across this error:
here is the source code that caused the error. It happens every time i load the page "/register"
This error does not occur when i remove the base64 encoded image from the html, is uvloop having trouble writing all the data at once?