Opened 2 years ago

Closed 2 years ago

#23672 closed defect (fixed)

hs-v3: With multiple SOCKS connection to the same .onion, don't trigger a descriptor fetch for each connection

Reported by: dgoulet Owned by: dgoulet
Priority: Medium Milestone: Tor: 0.3.2.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords: tor-hs, tor-client, prop224
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


This comes out of #23653 for a v3 only fix because a patch for v2 requires more refactoring.

We should only have one descriptor fetch at a time to an HSDir and not open one for each SOCKS connection. Because of how the client hsdir request cache works, you can't request the same .onion to the same HSDir inside a 15 minutes time frame (woa that is big). Thus, if we open 6 SOCKS requests and they all trigger a fetch, all HSDir are put in the cache and we can't query any of them while they are opened or until an error happened or until we can ultimately connect to the service.

Thus comes a bug where the 7th SOCKS connection (opened rapidly after the 6) will always fail because no HSDir can be used (#15937)

What we should do:

  1. At each SOCKS connection, check if we have a pending directory fetch for the .onion and if so, wait on it.
  1. On a fetch internal error, not allowed because of FetchHidServDescriptors 0 or no more HSDir are usable, close all pending SOCKS connections instead of making them timeout (#23653).

Child Tickets

Change History (5)

comment:1 Changed 2 years ago by dgoulet

Status: assignedneeds_review

See branch: bug23672_032_01

comment:2 Changed 2 years ago by asn

Status: needs_reviewmerge_ready

Looks good to me! This should fix the v3 side of #23653.

comment:4 Changed 2 years ago by dgoulet

Replied to Nickm's comments

Last edited 2 years ago by dgoulet (previous) (diff)

comment:5 Changed 2 years ago by nickm

Resolution: fixed
Status: merge_readyclosed

thanks for the updates! merging.

Note: See TracTickets for help on using tickets.