diff options
author | Martin Schanzenbach <schanzen@gnunet.org> | 2022-11-22 15:02:52 +0900 |
---|---|---|
committer | Martin Schanzenbach <schanzen@gnunet.org> | 2022-11-22 15:02:52 +0900 |
commit | e0aa0e3768090f600d476ba0b4c3a78446f42886 (patch) | |
tree | 8b1bd280c2d68c38c9850b4d3012ea19e25922f2 /src/zonemaster/gnunet-service-zonemaster.c | |
parent | 3fd0cfc52ca3befbb487814b480cdd3561c9ca5a (diff) | |
download | gnunet-e0aa0e3768090f600d476ba0b4c3a78446f42886.tar.gz gnunet-e0aa0e3768090f600d476ba0b4c3a78446f42886.zip |
-attempt to improve iterator halting
Diffstat (limited to 'src/zonemaster/gnunet-service-zonemaster.c')
-rw-r--r-- | src/zonemaster/gnunet-service-zonemaster.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/zonemaster/gnunet-service-zonemaster.c b/src/zonemaster/gnunet-service-zonemaster.c index ced9cddd4..33415c6f9 100644 --- a/src/zonemaster/gnunet-service-zonemaster.c +++ b/src/zonemaster/gnunet-service-zonemaster.c | |||
@@ -451,7 +451,7 @@ shutdown_task (void *cls) | |||
451 | GNUNET_DHT_put_cancel (job->ph); | 451 | GNUNET_DHT_put_cancel (job->ph); |
452 | free_job (job); | 452 | free_job (job); |
453 | } | 453 | } |
454 | if (NULL != statistics) | 454 | if (NULL != statistics) |
455 | { | 455 | { |
456 | GNUNET_STATISTICS_destroy (statistics, | 456 | GNUNET_STATISTICS_destroy (statistics, |
457 | GNUNET_NO); | 457 | GNUNET_NO); |
@@ -740,6 +740,15 @@ check_zone_namestore_next () | |||
740 | 740 | ||
741 | if (0 != ns_iteration_left) | 741 | if (0 != ns_iteration_left) |
742 | return; /* current NAMESTORE iteration not yet done */ | 742 | return; /* current NAMESTORE iteration not yet done */ |
743 | if (job_queue_length >= JOB_QUEUE_LIMIT) | ||
744 | { | ||
745 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | ||
746 | "Job queue length exceeded (%u/%u). Pausing namestore iteration.\n", | ||
747 | job_queue_length, | ||
748 | JOB_QUEUE_LIMIT); | ||
749 | iterator_halted = GNUNET_YES; | ||
750 | return; | ||
751 | } | ||
743 | update_velocity (put_cnt); | 752 | update_velocity (put_cnt); |
744 | put_cnt = 0; | 753 | put_cnt = 0; |
745 | delay = GNUNET_TIME_relative_subtract (target_iteration_velocity_per_record, | 754 | delay = GNUNET_TIME_relative_subtract (target_iteration_velocity_per_record, |
@@ -775,10 +784,10 @@ dht_put_continuation (void *cls) | |||
775 | struct RecordPublicationJob *job = cls; | 784 | struct RecordPublicationJob *job = cls; |
776 | 785 | ||
777 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 786 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
778 | "PUT complete\n"); | 787 | "PUT complete; Pending jobs: %u\n", job_queue_length - 1); |
779 | /* When we just fall under the limit, trigger monitor/iterator again | 788 | /* When we just fall under the limit, trigger monitor/iterator again |
780 | * if halted. We can only safely trigger one, prefer iterator. */ | 789 | * if halted. We can only safely trigger one, prefer iterator. */ |
781 | if (job_queue_length <= JOB_QUEUE_LIMIT - NS_BLOCK_SIZE) | 790 | if (job_queue_length <= JOB_QUEUE_LIMIT) |
782 | { | 791 | { |
783 | if (GNUNET_YES == iterator_halted) | 792 | if (GNUNET_YES == iterator_halted) |
784 | { | 793 | { |
@@ -1077,15 +1086,6 @@ handle_record (void *cls, | |||
1077 | rd_count, | 1086 | rd_count, |
1078 | expire); | 1087 | expire); |
1079 | job_queue_length++; | 1088 | job_queue_length++; |
1080 | if (job_queue_length >= JOB_QUEUE_LIMIT) | ||
1081 | { | ||
1082 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | ||
1083 | "Job queue length exceeded (%u/%u). Halting namestore iteration.\n", | ||
1084 | job_queue_length, | ||
1085 | JOB_QUEUE_LIMIT); | ||
1086 | iterator_halted = GNUNET_YES; | ||
1087 | return; | ||
1088 | } | ||
1089 | check_zone_namestore_next (); | 1089 | check_zone_namestore_next (); |
1090 | } | 1090 | } |
1091 | 1091 | ||