Thanks for the fixes!
Please, use [PATCH v2] prefix when sending second
version of a patch.
See 2 comments below.
On 18/07/2018 19:46, Georgy Kirichenko wrote:
socket_writable/socket_readable may return before timeout is exceeded
with the false status in cause of a spurious wakeup and this should not be
treated as an EOF or an error.
Fixed #3344
---
Issue: https://github.com/tarantool/tarantool/issues/3344
Branch:
https://github.com/tarantool/tarantool/tree/g.kirichenko/gh-3344-socket-io-spurios-wakeup
src/lua/socket.lua | 57 ++++++++++++++++----------------
test/app/socket.result | 70 ++++++++++++++++++++++++++++++++++++++++
test/app/socket.test.lua | 29 +++++++++++++++++
3 files changed, 129 insertions(+), 27 deletions(-)
diff --git a/src/lua/socket.lua b/src/lua/socket.lua
index 06306eae2..6ebcea055 100644
--- a/src/lua/socket.lua
+++ b/src/lua/socket.lua
@@ -337,11 +337,15 @@ local function do_wait(self, what, timeout)
end
local function socket_readable(self, timeout)
- return do_wait(self, 1, timeout) ~= 0
+ local result = do_wait(self, 1, timeout) ~= 0
+ fiber.testcancel()
+ return result
end
local function socket_writable(self, timeout)
- return do_wait(self, 2, timeout) ~= 0
+ local result = do_wait(self, 2, timeout) ~= 0
+ fiber.testcancel()
+ return result
end
local function socket_wait(self, timeout)