[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor] 75/77: hs_pow: fix error path with outdated assumption



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

dgoulet pushed a commit to branch main
in repository tor.

commit 971de27c0744deac7017d8da720eea39ad960a6f
Author: Micah Elizabeth Scott <beth@xxxxxxxxxxxxxx>
AuthorDate: Tue Apr 25 09:02:45 2023 -0700

    hs_pow: fix error path with outdated assumption
    
    This error path with the "PoW cpuworker returned with no solution.
    Will retry soon." message was usually lying. It's concerning
    now because we expect to always find a solution no matter how
    long it takes, rather than re-enter the solver repeatedly, so any
    exit without a solution is a sign of a problem.
    
    In fact when this error path gets hit, we are usually missing a
    circuit instead because the request is quite old and the circuits
    have been destroyed. This is not an emergency, it's just a sign
    of client-side overload.
    
    Signed-off-by: Micah Elizabeth Scott <beth@xxxxxxxxxxxxxx>
---
 src/feature/hs/hs_pow.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/feature/hs/hs_pow.c b/src/feature/hs/hs_pow.c
index 15152bc649..4f662b58d9 100644
--- a/src/feature/hs/hs_pow.c
+++ b/src/feature/hs/hs_pow.c
@@ -436,9 +436,11 @@ pow_worker_replyfn(void *work_)
     ip = find_desc_intro_point_by_ident(intro_circ->hs_ident, desc);
 
   if (intro_circ && rend_circ && service_identity_pk && desc && ip &&
-      job->pow_solution_out) { /* successful pow solve, and circs still here */
+      job->pow_solution_out) {
 
+    /* successful pow solve, and circs still here */
     log_info(LD_REND, "Got a PoW solution we like! Shipping it!");
+
     /* Set flag to reflect that the HS we are attempting to rendezvous has PoW
      * defenses enabled, and as such we will need to be more lenient with
      * timing out while waiting for the service-side circuit to be built. */
@@ -451,18 +453,16 @@ pow_worker_replyfn(void *work_)
       intro_circ->hs_currently_solving_pow = 0;
     }
 
-  } else { /* unsuccessful pow solve. put it back on the queue. */
-    log_notice(LD_REND,
-               "PoW cpuworker returned with no solution. Will retry soon.");
+  } else {
+    if (!job->pow_solution_out) {
+      log_warn(LD_REND, "PoW cpuworker returned with no solution");
+    } else {
+      log_info(LD_REND, "PoW solution completed but we can "
+                        "no longer locate its circuit");
+    }
     if (intro_circ) {
       intro_circ->hs_currently_solving_pow = 0;
     }
-    /* We could imagine immediately re-launching a follow-up worker
-     * here too, but for now just let the main intro loop find the
-     * not-being-serviced request and it can start everything again. For
-     * the sake of complexity, maybe that's the best long-term solution
-     * too, and we can tune the cpuworker job to try for longer if we want
-     * to improve efficiency. */
   }
 
   pow_worker_job_free(job);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits