Hi Tim,

Op 3-5-2018 om 0:26 schreef Tim Düsterhus:
Pieter,

Am 02.05.2018 um 23:54 schrieb PiBa-NL:
If commit message needs tweaking please feel free to do so :).

obviously not authoritative for this, but I noticed directly that the
first line of your message is very long. It should generally be about 60
characters, otherwise it might get truncated. The following lines should
be no more than 76 characters to avoid wrapping with the common terminal
width of 80.

Also after the severity and the component a colon should be used, not a
comma.

I suggest something like this for the first line. It is succinct and
gives a good idea of what the bug might me. But please check whether I
grasped the issue properly.

BUG/MINOR: lua: Put tasks to sleep when waiting for data

Best regards
Tim Düsterhus

Thanks, valid comments, the colons i should have noticed could have sworn i did those correctly.. but no ;). i thought i carefully constructed the commit message looking at a few others, while cramming in as much 'info' about the change/issue as possible on a line (better than 'fixed #123' as the whole subject&message as some committers do in a other project i contribute to., but thats off-topic.). As for line lengths, it didn't even cross my mind to look at that. (i also didn't lookup the contributing either sorry, though it doesn't seem to specify specific line lengths.?.)

Anyhow changed the title as suggested, it still covers the change. And adjusted line wrapping in the message to not exceed 76.

Regards,

PiBa-NL (Pieter)

From a0b01cdc8ccc4ae95c5c03bc98bf859b6115d2f9 Mon Sep 17 00:00:00 2001
From: PiBa-NL <piba.nl....@gmail.com>
Date: Wed, 2 May 2018 22:27:14 +0200
Subject: [PATCH] BUG/MINOR, BUG/MINOR: lua: Put tasks to sleep when waiting for 
data

If a lua socket is waiting for data it currently spins at 100% cpu usage.
This because the TICK_ETERNITY returned by the socket is ignored when 
setting the 'expire' time of the task.

Fixed by removing the check for yields that return TICK_ETERNITY.

This should be backported to at least 1.8.
---
 src/hlua.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/hlua.c b/src/hlua.c
index 32199c9..4c56409 100644
--- a/src/hlua.c
+++ b/src/hlua.c
@@ -5552,8 +5552,7 @@ static struct task *hlua_process_task(struct task *task)
 
        case HLUA_E_AGAIN: /* co process or timeout wake me later. */
                notification_gc(&hlua->com);
-               if (hlua->wake_time != TICK_ETERNITY)
-                       task->expire = hlua->wake_time;
+               task->expire = hlua->wake_time;
                break;
 
        /* finished with error. */
-- 
2.10.1.windows.1

Reply via email to