Software /
code /
prosody
Comparison
net/server_epoll.lua @ 10486:479e96e554c8
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.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 07 Dec 2019 19:05:10 +0100 |
parent | 10420:49a828819696 |
child | 10490:c9cff02c0528 |
comparison
equal
deleted
inserted
replaced
10485:913276ba0c47 | 10486:479e96e554c8 |
---|---|
658 if t == false then return; end | 658 if t == false then return; end |
659 self:set(false); | 659 self:set(false); |
660 self._pausefor = addtimer(t, function () | 660 self._pausefor = addtimer(t, function () |
661 self._pausefor = nil; | 661 self._pausefor = nil; |
662 self:set(true); | 662 self:set(true); |
663 self:debug("Resuming after pause, connection is %s", not self.conn and "missing" or self.conn:dirty() and "dirty" or "clean"); | |
663 if self.conn and self.conn:dirty() then | 664 if self.conn and self.conn:dirty() then |
664 self:onreadable(); | 665 self:onreadable(); |
665 end | 666 end |
666 end); | 667 end); |
667 end | 668 end |