Closed GoogleCodeExporter closed 9 years ago
Original comment by dsalli...@gmail.com
on 23 Jun 2009 at 1:39
I believe that another problem might be that we need to ensure that we have
updated the libevent event flag for
the socket before we can return (otherwise libevent will not trigger the
callback for the filedescriptor again). I'll
do a code review to verify this..
Original comment by trond.no...@gmail.com
on 26 Jun 2009 at 1:17
(and it may block if we have the next command in our input read buffer)
Original comment by trond.no...@gmail.com
on 26 Jun 2009 at 1:23
I believe that a better place to put this logic is in the conn_new_cmd state.
We will
always iterate through that state between each command.
All we need now is a good test case...
diff --git a/memcached.c b/memcached.c
index 6ad3231..440eb49 100644
--- a/memcached.c
+++ b/memcached.c
@@ -3199,10 +3199,7 @@ static void drive_machine(conn *c) {
conn_set_state(c, conn_waiting);
break;
case READ_DATA_RECEIVED:
- /* Only process nreqs at a time to avoid starving other
- connections */
- if (--nreqs)
- conn_set_state(c, conn_parse_cmd);
+ conn_set_state(c, conn_parse_cmd);
break;
case READ_ERROR:
conn_set_state(c, conn_closing);
@@ -3222,6 +3219,12 @@ static void drive_machine(conn *c) {
break;
case conn_new_cmd:
+ /* Only process nreqs at a time to avoid starving other
+ connections */
+ --nreqs;
+ if (nreqs == 0) {
+ stop = true;
+ }
reset_cmd_handler(c);
break;
Original comment by trond.no...@gmail.com
on 30 Jun 2009 at 6:44
Pushed a better fix and a test case:
http://github.com/trondn/memcached/commit/3ea9838fdbfac07cc50edafc4f85dc49a57b51
68
Original comment by trond.no...@gmail.com
on 30 Jun 2009 at 8:06
Original comment by trond.no...@gmail.com
on 30 Jun 2009 at 8:07
I pushed up a doc change for this in dustin/issue_61
Original comment by dsalli...@gmail.com
on 2 Jul 2009 at 3:12
Pushed in 1.4
Original comment by dsalli...@gmail.com
on 10 Jul 2009 at 4:23
Original issue reported on code.google.com by
steve....@gmail.com
on 22 Jun 2009 at 11:29