diff options
author | Kim Alvefur <zash@zash.se> | 2019-12-07 19:05:10 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2019-12-07 19:05:10 +0100 |
commit | d84a2484dce365fa5047eaf746930f9b6a7dccc2 (patch) | |
tree | 8c397254cf4f1bc92a270cf4309404bffac31e5d /net | |
parent | 9d5c3cb856ad15611be84d5324caa8413175f4fe (diff) | |
download | prosody-d84a2484dce365fa5047eaf746930f9b6a7dccc2.tar.gz prosody-d84a2484dce365fa5047eaf746930f9b6a7dccc2.zip |
net.server_epoll: Add debug logging for delayed reading
In :onreadable, if there is still buffered incoming data after reading
from the socket (as indicated by the :dirty method, usually because
LuaSocket has an 8k buffer that's full but it read a smaller amount),
another attempt to read is scheduled via this :pausefor method. This is
also called from some other places where it would be pointless to read
because there shouldn't be any data.
In the delayed read case, this should report that the socket is "dirty".
If it reports that the socket is "clean" then the question is where
the buffer contents went?
If this doesn't get logged after the scheduled time (0.000001s by
default) then this would suggests a problem with timer or scheduling.
Diffstat (limited to 'net')
-rw-r--r-- | net/server_epoll.lua | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua index d44149f3..17faa848 100644 --- a/net/server_epoll.lua +++ b/net/server_epoll.lua @@ -660,6 +660,7 @@ function interface:pausefor(t) self._pausefor = addtimer(t, function () self._pausefor = nil; self:set(true); + self:debug("Resuming after pause, connection is %s", not self.conn and "missing" or self.conn:dirty() and "dirty" or "clean"); if self.conn and self.conn:dirty() then self:onreadable(); end |