diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2012-12-12 11:11:12 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2012-12-12 11:11:12 +0000 |
commit | 24945b56d1b9a7ea42ac10b883e0c2e0ab20ee0d (patch) | |
tree | c485d460ce289cbad56836575efe3c6a45f54a07 | |
parent | d246fec0e9e840408e5cacfc6de038462a269712 (diff) | |
download | gnunet-24945b56d1b9a7ea42ac10b883e0c2e0ab20ee0d.tar.gz gnunet-24945b56d1b9a7ea42ac10b883e0c2e0ab20ee0d.zip |
add additional stage due to issues on powerbot:
initial address suggestion can take quite long during service startup
-rw-r--r-- | src/ats/test_ats_api.conf | 3 | ||||
-rw-r--r-- | src/ats/test_ats_api_scheduling_block_and_reset.c | 52 |
2 files changed, 45 insertions, 10 deletions
diff --git a/src/ats/test_ats_api.conf b/src/ats/test_ats_api.conf index 20d949a2e..7b4a07e15 100644 --- a/src/ats/test_ats_api.conf +++ b/src/ats/test_ats_api.conf | |||
@@ -22,6 +22,9 @@ UNIX_MATCH_GID = YES | |||
22 | # Enable MLP mode (default: NO) | 22 | # Enable MLP mode (default: NO) |
23 | MODE = SIMPLISTIC | 23 | MODE = SIMPLISTIC |
24 | # Network specific inbound/outbound quotas | 24 | # Network specific inbound/outbound quotas |
25 | # UNSPECIFIED | ||
26 | UNSPECIFIED_QUOTA_IN = 64 KiB | ||
27 | UNSPECIFIED_QUOTA_OUT = 64 KiB | ||
25 | # LOOPBACK | 28 | # LOOPBACK |
26 | LOOPBACK_QUOTA_IN = unlimited | 29 | LOOPBACK_QUOTA_IN = unlimited |
27 | LOOPBACK_QUOTA_OUT = unlimited | 30 | LOOPBACK_QUOTA_OUT = unlimited |
diff --git a/src/ats/test_ats_api_scheduling_block_and_reset.c b/src/ats/test_ats_api_scheduling_block_and_reset.c index 90ec0c757..82c859a6e 100644 --- a/src/ats/test_ats_api_scheduling_block_and_reset.c +++ b/src/ats/test_ats_api_scheduling_block_and_reset.c | |||
@@ -147,7 +147,7 @@ address_suggest_cb (void *cls, const struct GNUNET_HELLO_Address *address, | |||
147 | static int stage = 0; | 147 | static int stage = 0; |
148 | 148 | ||
149 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Stage %u\n", stage); | 149 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Stage %u\n", stage); |
150 | if (2 == stage) | 150 | if (3 == stage) |
151 | { | 151 | { |
152 | /* Suggestion after resetting block interval */ | 152 | /* Suggestion after resetting block interval */ |
153 | reset_block_duration = GNUNET_TIME_absolute_get_difference(reset_block_start, GNUNET_TIME_absolute_get()); | 153 | reset_block_duration = GNUNET_TIME_absolute_get_difference(reset_block_start, GNUNET_TIME_absolute_get()); |
@@ -196,7 +196,7 @@ address_suggest_cb (void *cls, const struct GNUNET_HELLO_Address *address, | |||
196 | GNUNET_SCHEDULER_add_now (&end, NULL); | 196 | GNUNET_SCHEDULER_add_now (&end, NULL); |
197 | 197 | ||
198 | } | 198 | } |
199 | if (1 == stage) | 199 | if (2 == stage) |
200 | { | 200 | { |
201 | /* Suggestion after block*/ | 201 | /* Suggestion after block*/ |
202 | block_duration = GNUNET_TIME_absolute_get_difference(block_start, GNUNET_TIME_absolute_get()); | 202 | block_duration = GNUNET_TIME_absolute_get_difference(block_start, GNUNET_TIME_absolute_get()); |
@@ -205,13 +205,13 @@ address_suggest_cb (void *cls, const struct GNUNET_HELLO_Address *address, | |||
205 | 205 | ||
206 | if (GNUNET_OK == compare_addresses (address, session, &test_hello_address, test_session)) | 206 | if (GNUNET_OK == compare_addresses (address, session, &test_hello_address, test_session)) |
207 | { | 207 | { |
208 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stage 0: Callback with correct address `%s'\n", | 208 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stage %u: Callback with correct address `%s'\n", stage, |
209 | GNUNET_i2s (&address->peer)); | 209 | GNUNET_i2s (&address->peer)); |
210 | ret = 0; | 210 | ret = 0; |
211 | } | 211 | } |
212 | else | 212 | else |
213 | { | 213 | { |
214 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stage 0: Callback with invalid address `%s'\n", | 214 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stage %u: Callback with invalid address `%s'\n", stage, |
215 | GNUNET_i2s (&address->peer)); | 215 | GNUNET_i2s (&address->peer)); |
216 | GNUNET_ATS_suggest_address_cancel (sched_ats, &p.id); | 216 | GNUNET_ATS_suggest_address_cancel (sched_ats, &p.id); |
217 | GNUNET_SCHEDULER_add_now (&end, NULL); | 217 | GNUNET_SCHEDULER_add_now (&end, NULL); |
@@ -220,7 +220,7 @@ address_suggest_cb (void *cls, const struct GNUNET_HELLO_Address *address, | |||
220 | 220 | ||
221 | if (GNUNET_OK != compare_ats(atsi, ats_count, test_ats_info, test_ats_count)) | 221 | if (GNUNET_OK != compare_ats(atsi, ats_count, test_ats_info, test_ats_count)) |
222 | { | 222 | { |
223 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Stage 0: Callback with incorrect ats info \n"); | 223 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Stage %u: Callback with incorrect ats info \n"); |
224 | GNUNET_ATS_suggest_address_cancel (sched_ats, &p.id); | 224 | GNUNET_ATS_suggest_address_cancel (sched_ats, &p.id); |
225 | GNUNET_SCHEDULER_add_now (&end, NULL); | 225 | GNUNET_SCHEDULER_add_now (&end, NULL); |
226 | ret = 1; | 226 | ret = 1; |
@@ -232,18 +232,18 @@ address_suggest_cb (void *cls, const struct GNUNET_HELLO_Address *address, | |||
232 | reset_block_start = GNUNET_TIME_absolute_get(); | 232 | reset_block_start = GNUNET_TIME_absolute_get(); |
233 | GNUNET_ATS_suggest_address (sched_ats, &p.id); | 233 | GNUNET_ATS_suggest_address (sched_ats, &p.id); |
234 | } | 234 | } |
235 | if (0 == stage) | 235 | if (1 == stage) |
236 | { | 236 | { |
237 | /* Initial suggestion */ | 237 | /* Initial suggestion */ |
238 | if (GNUNET_OK == compare_addresses (address, session, &test_hello_address, test_session)) | 238 | if (GNUNET_OK == compare_addresses (address, session, &test_hello_address, test_session)) |
239 | { | 239 | { |
240 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stage 0: Callback with correct address `%s'\n", | 240 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stage %u: Callback with correct address `%s'\n", stage, |
241 | GNUNET_i2s (&address->peer)); | 241 | GNUNET_i2s (&address->peer)); |
242 | ret = 0; | 242 | ret = 0; |
243 | } | 243 | } |
244 | else | 244 | else |
245 | { | 245 | { |
246 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stage 0: Callback with invalid address `%s'\n", | 246 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stage %u: Callback with invalid address `%s'\n", stage, |
247 | GNUNET_i2s (&address->peer)); | 247 | GNUNET_i2s (&address->peer)); |
248 | GNUNET_ATS_suggest_address_cancel (sched_ats, &p.id); | 248 | GNUNET_ATS_suggest_address_cancel (sched_ats, &p.id); |
249 | GNUNET_SCHEDULER_add_now (&end, NULL); | 249 | GNUNET_SCHEDULER_add_now (&end, NULL); |
@@ -252,19 +252,51 @@ address_suggest_cb (void *cls, const struct GNUNET_HELLO_Address *address, | |||
252 | 252 | ||
253 | if (GNUNET_OK != compare_ats(atsi, ats_count, test_ats_info, test_ats_count)) | 253 | if (GNUNET_OK != compare_ats(atsi, ats_count, test_ats_info, test_ats_count)) |
254 | { | 254 | { |
255 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Stage 0: Callback with incorrect ats info \n"); | 255 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Stage %u: Callback with incorrect ats info \n"); |
256 | GNUNET_ATS_suggest_address_cancel (sched_ats, &p.id); | 256 | GNUNET_ATS_suggest_address_cancel (sched_ats, &p.id); |
257 | GNUNET_SCHEDULER_add_now (&end, NULL); | 257 | GNUNET_SCHEDULER_add_now (&end, NULL); |
258 | ret = 1; | 258 | ret = 1; |
259 | } | 259 | } |
260 | stage ++; | 260 | stage ++; |
261 | initial_duration = GNUNET_TIME_absolute_get_difference(initial_start, GNUNET_TIME_absolute_get()); | 261 | initial_duration = GNUNET_TIME_absolute_get_difference(initial_start, GNUNET_TIME_absolute_get()); |
262 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Initial suggestion took about %llu ms\n", | 262 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Stage %u: Initial suggestion took about %llu ms\n", stage, |
263 | (long long unsigned int) block_duration.rel_value); | 263 | (long long unsigned int) block_duration.rel_value); |
264 | 264 | ||
265 | block_start = GNUNET_TIME_absolute_get(); | 265 | block_start = GNUNET_TIME_absolute_get(); |
266 | wait_task = GNUNET_SCHEDULER_add_delayed (WAIT, &request_task, NULL); | 266 | wait_task = GNUNET_SCHEDULER_add_delayed (WAIT, &request_task, NULL); |
267 | } | 267 | } |
268 | if (0 == stage) | ||
269 | { | ||
270 | /* Startup suggestion */ | ||
271 | if (GNUNET_OK == compare_addresses (address, session, &test_hello_address, test_session)) | ||
272 | { | ||
273 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stage %u: Callback with correct address `%s'\n", stage, | ||
274 | GNUNET_i2s (&address->peer)); | ||
275 | ret = 0; | ||
276 | } | ||
277 | else | ||
278 | { | ||
279 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stage %u: Callback with invalid address `%s'\n", stage, | ||
280 | GNUNET_i2s (&address->peer)); | ||
281 | GNUNET_ATS_suggest_address_cancel (sched_ats, &p.id); | ||
282 | GNUNET_SCHEDULER_add_now (&end, NULL); | ||
283 | ret = 1; | ||
284 | } | ||
285 | |||
286 | if (GNUNET_OK != compare_ats(atsi, ats_count, test_ats_info, test_ats_count)) | ||
287 | { | ||
288 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Stage %u: Callback with incorrect ats info \n"); | ||
289 | GNUNET_ATS_suggest_address_cancel (sched_ats, &p.id); | ||
290 | GNUNET_SCHEDULER_add_now (&end, NULL); | ||
291 | ret = 1; | ||
292 | } | ||
293 | stage ++; | ||
294 | |||
295 | GNUNET_ATS_suggest_address_cancel (sched_ats, &p.id); | ||
296 | |||
297 | initial_start = GNUNET_TIME_absolute_get(); | ||
298 | GNUNET_ATS_suggest_address (sched_ats, &p.id); | ||
299 | } | ||
268 | } | 300 | } |
269 | 301 | ||
270 | 302 | ||