Permalink
Browse files

I am the world's biggest moron.

of course there's a race condition, if you close the bloody socket before
setting the state to conn_closed. The amount of time I looked straight at it
and didn't see it is causing me physical pain.
  • Loading branch information...
1 parent 8278df6 commit e73bc2e5c0794cccd6f8ece63bc16433c40ed766 @dormando dormando committed May 11, 2014
Showing with 3 additions and 4 deletions.
  1. +3 −4 memcached.c
View
@@ -568,8 +568,8 @@ static void conn_close(conn *c) {
conn_cleanup(c);
MEMCACHED_CONN_RELEASE(c->sfd);
- close(c->sfd);
conn_set_state(c, conn_closed);
+ close(c->sfd);
pthread_mutex_lock(&conn_lock);
allow_new_conns = true;
@@ -4321,9 +4321,8 @@ static void drive_machine(conn *c) {
break;
case conn_closed:
- /* This possibly only ever happens if you have built against a
- * broken libevent and event_del fails. */
- stop = true;
+ /* This only happens if dormando is an idiot. */
+ abort();
break;
case conn_max_state:

1 comment on commit e73bc2e

JJJ commented on e73bc2e Feb 15, 2016

:hug:

Please sign in to comment.