gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnunet] branch master updated (cde1c9fb5 -> c6f178907)


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated (cde1c9fb5 -> c6f178907)
Date: Fri, 29 Dec 2017 00:56:17 +0100

This is an automated email from the git hooks/post-receive script.

julius-buenger pushed a change to branch master
in repository gnunet.

    from cde1c9fb5 add assertion
     new b36a7b8fb rps: fix double call
     new 6aff93344 rps: prepare cancellation of messages
     new bbed9b3ec rps: add assertion
     new 6380681b8 rps: improve churn testing
     new c6f178907 Merge branch 'master' of gn:gnunet

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/rps/.gitignore                 |  2 +-
 src/rps/gnunet-service-rps.c       |  1 -
 src/rps/gnunet-service-rps_peers.c | 16 ++++++++---
 src/rps/test_rps.c                 | 58 +++++++++++++++++++++++++++++++++++++-
 4 files changed, 70 insertions(+), 7 deletions(-)

diff --git a/src/rps/.gitignore b/src/rps/.gitignore
index 77c9a498c..e45356eda 100644
--- a/src/rps/.gitignore
+++ b/src/rps/.gitignore
@@ -12,4 +12,4 @@ test_service_rps_custommap
 test_service_rps_peers
 test_service_rps_sampler_elem
 test_service_rps_view
-
+test_rps_churn
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c
index 124b82b72..bea3df233 100644
--- a/src/rps/gnunet-service-rps.c
+++ b/src/rps/gnunet-service-rps.c
@@ -1121,7 +1121,6 @@ handle_client_request_cancel (void *cls,
           (rep_cls->id != ntohl (msg->id)) )
     rep_cls = rep_cls->next;
   GNUNET_assert (rep_cls->id == ntohl (msg->id));
-  RPS_sampler_request_cancel (rep_cls->req_handle);
   destroy_reply_cls (rep_cls);
   GNUNET_SERVICE_client_continue (cli_ctx->client);
 }
diff --git a/src/rps/gnunet-service-rps_peers.c 
b/src/rps/gnunet-service-rps_peers.c
index 9cc4d3228..933e3cb87 100644
--- a/src/rps/gnunet-service-rps_peers.c
+++ b/src/rps/gnunet-service-rps_peers.c
@@ -653,17 +653,23 @@ insert_pending_message (const struct GNUNET_PeerIdentity 
*peer,
  * @brief Remove a pending message from the respective DLL
  *
  * @param pending_msg the pending message to remove
+ * @param cancel cancel the pending message, too
  */
 static void
-remove_pending_message (struct PendingMessage *pending_msg)
+remove_pending_message (struct PendingMessage *pending_msg, int cancel)
 {
   struct PeerContext *peer_ctx;
 
   peer_ctx = pending_msg->peer_ctx;
+  GNUNET_assert (NULL != peer_ctx);
   GNUNET_CONTAINER_DLL_remove (peer_ctx->pending_messages_head,
                                peer_ctx->pending_messages_tail,
                                pending_msg);
-  GNUNET_MQ_send_cancel (peer_ctx->pending_messages_head->ev);
+  // TODO wait for the cadet implementation of message cancellation
+  //if (GNUNET_YES == cancel)
+  //{
+  //  GNUNET_MQ_send_cancel (pending_msg->ev);
+  //}
   GNUNET_free (pending_msg);
 }
 
@@ -728,7 +734,8 @@ mq_notify_sent_cb (void *cls)
   LOG (GNUNET_ERROR_TYPE_DEBUG,
       "%s was sent.\n",
       pending_msg->type);
-  remove_pending_message (pending_msg);
+  /* Do not cancle message */
+  remove_pending_message (pending_msg, GNUNET_NO);
 }
 
 
@@ -1154,7 +1161,8 @@ Peers_remove_peer (const struct GNUNET_PeerIdentity *peer)
     LOG (GNUNET_ERROR_TYPE_DEBUG,
         "Removing unsent %s\n",
         peer_ctx->pending_messages_head->type);
-    remove_pending_message (peer_ctx->pending_messages_head);
+    /* Cancle pending message, too */
+    remove_pending_message (peer_ctx->pending_messages_head, GNUNET_YES);
   }
   /* If we are still waiting for notification whether this peer is live
    * cancel the according task */
diff --git a/src/rps/test_rps.c b/src/rps/test_rps.c
index b8f7588e1..0114a19fe 100644
--- a/src/rps/test_rps.c
+++ b/src/rps/test_rps.c
@@ -1028,6 +1028,33 @@ req_cancel_cb (struct RPSPeer *rps_peer)
 }
 
 /***********************************
+ * CHURN
+***********************************/
+
+static void
+churn (void *cls);
+
+static void
+churn_test_cb (struct RPSPeer *rps_peer)
+{
+  /* Start churn */
+  if (GNUNET_YES == cur_test_run.have_churn && NULL == churn_task)
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                "Starting churn task\n");
+    churn_task = GNUNET_SCHEDULER_add_delayed (
+          GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5),
+          churn,
+          NULL);
+  } else {
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                "Not starting churn task\n");
+  }
+
+  schedule_missing_requests (rps_peer);
+}
+
+/***********************************
  * PROFILER
 ***********************************/
 
@@ -1153,6 +1180,9 @@ churn (void *cls)
   double portion_go_online;
   double portion_go_offline;
 
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "Churn function executing\n");
+
   /* Compute the probability for an online peer to go offline
    * this round */
   portion_online = num_peers_online * 1.0 / num_peers;
@@ -1263,10 +1293,15 @@ profiler_cb (struct RPSPeer *rps_peer)
   /* Start churn */
   if (GNUNET_YES == cur_test_run.have_churn && NULL == churn_task)
   {
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                "Starting churn task\n");
     churn_task = GNUNET_SCHEDULER_add_delayed (
           GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5),
           churn,
           NULL);
+  } else {
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                "Not starting churn task\n");
   }
 
   /* Only request peer ids at one peer.
@@ -1358,6 +1393,24 @@ run (void *cls,
   struct OpListEntry *entry;
   uint32_t num_mal_peers;
 
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "RUN was called\n");
+
+  /* Check whether we timed out */
+  if (n_peers != num_peers ||
+      NULL == peers ||
+      0 == links_succeeded)
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Going down due to args (eg. 
timeout)\n");
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "\tn_peers: %u\n", n_peers);
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "\tnum_peers: %" PRIu32 "\n", 
num_peers);
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "\tpeers: %p\n", peers);
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "\tlinks_succeeded: %u\n", 
links_succeeded);
+    GNUNET_SCHEDULER_shutdown ();
+    return;
+  }
+
+
+  /* Initialize peers */
   testbed_peers = peers;
   num_peers_online = 0;
   for (i = 0; i < num_peers; i++)
@@ -1515,7 +1568,10 @@ main (int argc, char *argv[])
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test churn\n");
     cur_test_run.name = "test-rps-churn";
     num_peers = 5;
-    cur_test_run.main_test = single_req_cb;
+    cur_test_run.init_peer = default_init_peer;
+    cur_test_run.main_test = churn_test_cb;
+    cur_test_run.reply_handle = default_reply_handle;
+    cur_test_run.eval_cb = default_eval_cb;
     cur_test_run.have_churn = GNUNET_YES;
     timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10);
   }

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]