change to dht profiling driver to avoid possible find peer issue
authorNathan S. Evans <evans@in.tum.de>
Tue, 15 Feb 2011 11:54:55 +0000 (11:54 +0000)
committerNathan S. Evans <evans@in.tum.de>
Tue, 15 Feb 2011 11:54:55 +0000 (11:54 +0000)
src/dht/dht_api.c
src/dht/gnunet-dht-driver.c

index 6194e02cf1593138095a10b72cad8f485761225b..ae191660a3e66607a5736f669acb0dad8045d20f 100644 (file)
@@ -298,7 +298,7 @@ try_reconnect (void *cls,
   handle->client = GNUNET_CLIENT_connect ("dht", handle->cfg);
   if (handle->client == NULL)
     {
-      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                   "dht reconnect failed(!)\n");
       return;
     }
index 16e3aa93d63b997740adedd6ca6e59c1069dc994..dfe073ce54f29101f90798f92785bb47838fda23 100644 (file)
@@ -448,6 +448,11 @@ static unsigned long long test_data_size = DEFAULT_TEST_DATA_SIZE;
  */
 static unsigned long long max_outstanding_connections;
 
+/**
+ * Maximum number of concurrent ssh instances to peers.
+ */
+static unsigned long long max_concurrent_ssh;
+
 /**
  * Maximum number of concurrent PUT requests.
  */
@@ -2100,7 +2105,12 @@ schedule_find_peer_requests (void *cls, const struct GNUNET_SCHEDULER_TaskContex
   for (i = 0; i < find_peer_ctx->total; i++)
     {
       test_find_peer = GNUNET_malloc(sizeof(struct TestFindPeer));
-      if (find_peer_ctx->previous_peers == 0) /* If we haven't sent any requests yet, choose random peers */
+      /* If we haven't sent any requests yet, choose random peers */
+      /* Also choose random in _half_ of all cases, so we don't
+       * get stuck choosing topologically restricted peers with
+       * few connections that will never be able to find any new
+       * peers! */
+      if ((find_peer_ctx->previous_peers == 0) || (i % 2 == 0))
         {
           /**
            * Attempt to spread find peer requests across even sections of the peer address
@@ -2816,6 +2826,14 @@ run (void *cls,
       return;
     }
 
+  if (GNUNET_OK !=
+        GNUNET_CONFIGURATION_get_value_number (cfg, "testing", "max_concurrent_ssh",
+                                               &max_concurrent_ssh))
+    {
+      GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Must provide option %s:%s!\n", "testing", "max_concurrent_ssh");
+      return;
+    }
+
   /**
    * Get DHT specific testing options.
    */
@@ -2998,7 +3016,7 @@ run (void *cls,
           {
             data[count] = '\0';
             temphost = GNUNET_malloc(sizeof(struct GNUNET_TESTING_Host));
-            ret = sscanf(buf, "%a[a-zA-Z0-9]@%a[a-zA-Z0-9.]:%hd", &temphost->username, &temphost->hostname, &temphost->port);
+            ret = sscanf(buf, "%a[a-zA-Z0-9_]@%a[a-zA-Z0-9.]:%hd", &temphost->username, &temphost->hostname, &temphost->port);
             if (3 == ret)
               {
                 GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Successfully read host %s, port %d and user %s from file\n", temphost->hostname, temphost->port, temphost->username);
@@ -3368,6 +3386,7 @@ run (void *cls,
   pg = GNUNET_TESTING_daemons_start (cfg,
                                      peers_left,
                                      max_outstanding_connections,
+                                     max_concurrent_ssh,
                                      GNUNET_TIME_relative_multiply(seconds_per_peer_start, num_peers),
                                      &hostkey_callback, NULL,
                                      &peers_started_callback, NULL,