Diligently check poll() a bit more. Also determine number of servers based on cores...
authorBrian Aker <brian@tangent.org>
Wed, 13 Jun 2012 03:58:18 +0000 (20:58 -0700)
committerBrian Aker <brian@tangent.org>
Wed, 13 Jun 2012 03:58:18 +0000 (20:58 -0700)
libmemcached/io.cc
tests/libmemcached-1.0/all_tests.cc

index 56239529eb2918a664c0d6971b51c92d1bc796f2..b08473a0c9bef42206d352c542f34a336c1549ad 100644 (file)
@@ -218,7 +218,13 @@ static memcached_return_t io_wait(memcached_server_write_instance_st ptr,
         break;
       }
       assert_msg(active_fd == 1 , "poll() returned an unexpected value");
-      return MEMCACHED_SUCCESS;
+      
+      if (fds.revents & POLLIN or fds.revents & POLLOUT)
+      {
+        return MEMCACHED_SUCCESS;
+      }
+
+      return memcached_set_error(*ptr, MEMCACHED_FAILURE, MEMCACHED_AT, memcached_literal_param("poll() returned a value that was not dealt with"));
     }
     else if (active_fd == 0)
     {
index 4d4d4ca8be20b1a40f1720df354b0d4547fbd2d0..2efbdf27803f931a57c04e2bd6388bb92f8a69d0 100644 (file)
@@ -79,7 +79,8 @@ void get_world(Framework *world)
   }
   else
   {
-    world->servers().set_servers_to_run(8);
+    world->servers().set_servers_to_run(libtest::number_of_cpus() > 3 ? 
+                                        libtest::number_of_cpus() : 3);
   }
 
   world->collections(collection);