[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r10406 - in gnunet: . src/core src/fs
From: |
gnunet |
Subject: |
[GNUnet-SVN] r10406 - in gnunet: . src/core src/fs |
Date: |
Mon, 22 Feb 2010 14:58:37 +0100 |
Author: grothoff
Date: 2010-02-22 14:58:37 +0100 (Mon, 22 Feb 2010)
New Revision: 10406
Modified:
gnunet/TODO
gnunet/src/core/gnunet-service-core.c
gnunet/src/fs/Makefile.am
gnunet/src/fs/gnunet-service-fs.c
gnunet/src/fs/test_fs_lib_data.conf
Log:
debug fun
Modified: gnunet/TODO
===================================================================
--- gnunet/TODO 2010-02-22 12:26:46 UTC (rev 10405)
+++ gnunet/TODO 2010-02-22 13:58:37 UTC (rev 10406)
@@ -15,10 +15,16 @@
Urgent items (before announcing ng.gnunet.org):
* FS (basic anonymous FS only)
- test multi-peer search/download
+ + existing bandwidth-reservation code does not work with FS: don't get
+ DBLOCK size bandwidth for reply for a while => trouble for testcase
+ => need to more aggressively increase bandwidth per connection
+ => need to check that bandwidth is assigned properly to begin with
+ + Even with bandwidth-reservation code restricted, message is not
+ delivered to other core/peer/fs. Why?
+ + Same query is sent to the same peer in rather rapid succession
(10x/minute?),
+ should tune code to reduce repetition...
* new webpage
- run peer => have a 0.9.x hostlist
- - improve basic documentation (configure, dependencies, what works, etc.)
- => get books to work, integrate Ji Lu's page in dev book!
=> Deploy(able) development network
Modified: gnunet/src/core/gnunet-service-core.c
===================================================================
--- gnunet/src/core/gnunet-service-core.c 2010-02-22 12:26:46 UTC (rev
10405)
+++ gnunet/src/core/gnunet-service-core.c 2010-02-22 13:58:37 UTC (rev
10406)
@@ -717,13 +717,16 @@
struct GNUNET_TIME_Absolute *ts, unsigned int bpm)
{
struct GNUNET_TIME_Relative since;
+ unsigned long long increment;
since = GNUNET_TIME_absolute_get_duration (*ts);
+ increment = (bpm * since.value) / 60 / 1000;
if ( (force == GNUNET_NO) &&
- (since.value < 60 * 1000) )
+ (since.value < 60 * 1000) &&
+ (increment < 32 * 1024) )
return; /* not even a minute has passed */
*ts = GNUNET_TIME_absolute_get ();
- *window += (bpm * since.value) / 60 / 1000;
+ *window += increment;
if (*window > MAX_WINDOW_TIME * bpm)
*window = MAX_WINDOW_TIME * bpm;
}
@@ -936,7 +939,8 @@
const struct RequestInfoMessage *rcm;
struct Neighbour *n;
struct ConfigurationInfoMessage cim;
- int reserv;
+ int want_reserv;
+ int got_reserv;
unsigned long long old_preference;
struct GNUNET_SERVER_TransmitContext *tc;
@@ -956,19 +960,21 @@
n->bpm_out_internal_limit = ntohl (rcm->limit_outbound_bpm);
n->bpm_out = GNUNET_MAX (n->bpm_out_internal_limit,
n->bpm_out_external_limit);
- reserv = ntohl (rcm->reserve_inbound);
- if (reserv < 0)
+ want_reserv = ntohl (rcm->reserve_inbound);
+ if (want_reserv < 0)
{
- n->available_recv_window += reserv;
+ n->available_recv_window += want_reserv;
}
- else if (reserv > 0)
+ else if (want_reserv > 0)
{
update_window (GNUNET_NO,
&n->available_recv_window,
&n->last_arw_update, n->bpm_in);
- if (n->available_recv_window < reserv)
- reserv = n->available_recv_window;
- n->available_recv_window -= reserv;
+ if (n->available_recv_window < want_reserv)
+ got_reserv = n->available_recv_window;
+ else
+ got_reserv = want_reserv;
+ n->available_recv_window -= got_reserv;
}
old_preference = n->current_preference;
n->current_preference += GNUNET_ntohll(rcm->preference_change);
@@ -978,7 +984,12 @@
n->current_preference = (unsigned long long) -1;
}
update_preference_sum (n->current_preference - old_preference);
- cim.reserved_amount = htonl (reserv);
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "Received reservation request for %d bytes for peer `%4s',
reserved %d bytes\n",
+ want_reserv,
+ GNUNET_i2s (&rcm->peer),
+ got_reserv);
+ cim.reserved_amount = htonl (got_reserv);
cim.bpm_in = htonl (n->bpm_in);
cim.bpm_out = htonl (n->bpm_out);
cim.preference = n->current_preference;
Modified: gnunet/src/fs/Makefile.am
===================================================================
--- gnunet/src/fs/Makefile.am 2010-02-22 12:26:46 UTC (rev 10405)
+++ gnunet/src/fs/Makefile.am 2010-02-22 13:58:37 UTC (rev 10406)
@@ -138,8 +138,8 @@
test_fs_start_stop \
test_fs_unindex \
test_fs_uri \
- test_fs_test_lib \
- test_gnunet_service_fs_p2p
+ test_fs_test_lib
+# test_gnunet_service_fs_p2p
# $(check_PROGRAMS)
Modified: gnunet/src/fs/gnunet-service-fs.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs.c 2010-02-22 12:26:46 UTC (rev 10405)
+++ gnunet/src/fs/gnunet-service-fs.c 2010-02-22 13:58:37 UTC (rev 10406)
@@ -959,7 +959,7 @@
{
#if DEBUG_FS
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Dropping reply, core too busy.\n");
+ "Dropping message, core too busy.\n");
#endif
return 0;
}
@@ -984,6 +984,12 @@
&transmit_to_peer,
pm);
}
+#if DEBUG_FS
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Transmitting %u bytes to peer %u.\n",
+ msize,
+ cp->pid);
+#endif
return msize;
}
@@ -1039,6 +1045,10 @@
}
if (cp->cth == NULL)
{
+#if DEBUG_FS
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Failed to schedule transmission with core!\n");
+#endif
/* FIXME: call stats (rare, bad case) */
}
}
@@ -1227,19 +1237,41 @@
if (cp == NULL)
{
/* Peer must have just left */
+#if DEBUG_FS
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Selected peer disconnected!\n");
+#endif
return;
}
no_route = GNUNET_NO;
- if (amount != DBLOCK_SIZE)
+ /* FIXME: check against DBLOCK_SIZE and possibly return
+ amount to reserve; however, this also needs to work
+ with testcases which currently start out with a far
+ too low per-peer bw limit, so they would never send
+ anything. Big issue. */
+ if (amount == 0)
{
if (pr->cp == NULL)
- return; /* this target round failed */
+ {
+#if DEBUG_FS
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Failed to reserve bandwidth for reply (got %d/%u bytes
only)!\n",
+ amount,
+ DBLOCK_SIZE);
+#endif
+ return; /* this target round failed */
+ }
/* FIXME: if we are "quite" busy, we may still want to skip
this round; need more load detection code! */
no_route = GNUNET_YES;
}
/* build message and insert message into priority queue */
+#if DEBUG_FS
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Forwarding request to `%4s'!\n",
+ GNUNET_i2s (peer));
+#endif
k = 0;
bm = 0;
if (GNUNET_YES == no_route)
@@ -1389,7 +1421,13 @@
&target_peer_select_cb,
&psc);
if (psc.target_score == DBL_MIN)
- return; /* nobody selected */
+ {
+#if DEBUG_FS
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "No peer selected for forwarding!\n");
+#endif
+ return; /* nobody selected */
+ }
/* (2) reserve reply bandwidth */
cp = GNUNET_CONTAINER_multihashmap_get (connected_peers,
@@ -1913,6 +1951,10 @@
pr->drq = NULL;
if (NULL == key)
{
+#if DEBUG_FS
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Done processing local replies, forwarding request to other
peers.\n");
+#endif
if (pr->client_request_list != NULL)
GNUNET_SERVER_receive_done
(pr->client_request_list->client_list->client,
GNUNET_YES);
@@ -1925,6 +1967,10 @@
}
if (type == GNUNET_DATASTORE_BLOCKTYPE_ONDEMAND)
{
+#if DEBUG_FS
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Found ONDEMAND block, performing on-demand encoding\n");
+#endif
if (GNUNET_OK !=
GNUNET_FS_handle_on_demand_block (key, size, data, type, priority,
anonymity, expiration, uid,
@@ -1989,10 +2035,15 @@
prq.priority = priority;
process_reply (&prq, key, pr);
- if ( (GNUNET_YES == test_load_too_high()) ||
- (pr->results_found > 5 + 2 * pr->priority) ||
- (type == GNUNET_DATASTORE_BLOCKTYPE_DBLOCK) )
+ if ( ( (pr->client_request_list == NULL) &&
+ ( (GNUNET_YES == test_load_too_high()) ||
+ (pr->results_found > 5 + 2 * pr->priority) ) ) ||
+ (type == GNUNET_DATASTORE_BLOCKTYPE_DBLOCK) )
{
+#if DEBUG_FS
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Unique reply found or load too high, done with request\n");
+#endif
GNUNET_FS_drq_get_next (GNUNET_NO);
return;
}
@@ -2164,7 +2215,18 @@
cp = cps;
if (cp == NULL)
{
- /* FIXME: try connect? */
+#if DEBUG_FS
+ if (0 != (bm & GET_MESSAGE_BIT_RETURN_TO))
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Failed to find RETURN-TO peer `%4s' in connection set.
Dropping query.\n",
+ GNUNET_i2s ((const struct GNUNET_PeerIdentity*)
&opt[bits-1]));
+
+ else
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Failed to find peer `%4s' in connection set. Dropping
query.\n",
+ GNUNET_i2s (other));
+#endif
+ /* FIXME: try connect? */
return GNUNET_OK;
}
/* note that we can really only check load here since otherwise
@@ -2250,6 +2312,11 @@
/* existing request has higher TTL, drop new one! */
cdc.have->priority += pr->priority;
destroy_pending_request (pr);
+#if DEBUG_FS
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Have existing request with higher TTL, dropping new
request.\n",
+ GNUNET_i2s (other));
+#endif
return GNUNET_OK;
}
else
@@ -2390,6 +2457,10 @@
crl = crl->next;
if (crl != NULL)
{
+#if DEBUG_FS
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Have existing request, merging content-seen lists.\n");
+#endif
pr = crl->req;
/* Duplicate request (used to send long list of
known/blocked results); merge 'pr->replies_seen'
Modified: gnunet/src/fs/test_fs_lib_data.conf
===================================================================
--- gnunet/src/fs/test_fs_lib_data.conf 2010-02-22 12:26:46 UTC (rev 10405)
+++ gnunet/src/fs/test_fs_lib_data.conf 2010-02-22 13:58:37 UTC (rev 10406)
@@ -38,6 +38,8 @@
[core]
PORT = 43470
HOSTNAME = localhost
+#TOTAL_QUOTA_IN = 3932160
+#TOTAL_QUOTA_OUT = 3932160
#DEBUG = YES
[fs]
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r10406 - in gnunet: . src/core src/fs,
gnunet <=