[MRG+1] 0 delay inside utils/defer.py->defer_succeed makes reactor not to be async enough #1075
Conversation
… cycles to accomplish its needs.
This comment has been minimized.
This comment has been minimized.
This fixes issue #1074 |
do you have a particular real-world case where this change produces a clear improvement? |
Yes, sure. Please see the issue #1074. |
+1 to merge. The original intention of |
The background on this issue is that Twisted process timed calls before file descriptors. Zero delay means it will process all delayed calls (pending and newly generated while processing existent calls) immediately after it reaches the reactor loop for 1 second max, only then it attend file descriptors but the next iteration will be busy again for 1 second handling delayed calls. Scrapy generates lot of delayed calls, it is not rare to add more delayed calls from within delayed calls, so the IO loop is not handling real IO most of the time. |
Closed by #1253 |
This will make scrapy to be more async by letting the reactor spend extra cycles to accomplish its needs.