Opened 2 months ago

Last modified 3 weeks ago

#31632 assigned defect

hs-v3: Service doesn't re-upload descriptor on circuit failure

Reported by: dgoulet Owned by: dgoulet
Priority: Medium Milestone: Tor: 0.4.3.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords: tor-hs, 042-deferred-20190918
Cc: asn Actual Points:
Parent ID: #30200 Points: 0.5
Reviewer: asn Sponsor: Sponsor27-must

Description

I'm observing, quite often actually, a service posting its descriptor to an HSDir but the circuit collapses due to remote reason CHANNEL_CLOSED.

This is possible for many reasons where a link between two relays failed/disconnected/closed/...

However, we do not retry the upload after that which means that we can end up with HSDir(s) without our descriptor even though we think they are there.

Solution is unclear but it appears that we probably want to hook this case into hs_circ_cleanup() which is called from the mark for close function.

Child Tickets

Change History (7)

comment:1 Changed 8 weeks ago by nickm

Keywords: 042-deferred-20190918 added
Milestone: Tor: 0.4.2.x-finalTor: unspecified

Deferring various tickets from 0.4.2 to Unspecified.

comment:2 Changed 7 weeks ago by neel

Owner: set to neel
Status: newassigned

comment:3 Changed 7 weeks ago by neel

Owner: neel deleted

comment:4 Changed 7 weeks ago by neel

Status: assignednew

comment:5 Changed 7 weeks ago by arma

For the v2 case, check out these elements in the descriptor struct:

  /** Has descriptor been uploaded to all hidden service directories? */
  int all_uploads_performed;
  /** List of hidden service directories to which an upload request for
   * this descriptor could be sent. Smartlist exists only when at least one
   * of the previous upload requests failed (otherwise it's not important
   * to know which uploads succeeded and which not). */
  smartlist_t *successful_uploads;

So v2 has the ability to notice that it e.g. doesn't have enough directory information about a given hsdir, and it will try republishing to just those hsdirs later in that case. But v2 is still missing the feature where the hsdir info is all set, and we make the circuit and attempt the upload, and something goes wrong with the circuit or stream.

I looked at hs_circ_cleanup(), and maybe it is useful here but it's not obvious how.

My thought instead would be to put something like the above v2 state into the v3 descriptor struct, and then hook connection_dir_client_request_failed() to note that a given hsdir upload needs to be retried on the next iteration. See how connection_dir_about_to_close(), which calls that request_failed function, has a call to connection_dir_client_refetch_hsdesc_if_needed(). We could expand that refetch function to be about refetching-or-reposting, or we could make a second parallel function that is about reposting if needed.)

comment:6 Changed 4 weeks ago by dgoulet

Milestone: Tor: unspecifiedTor: 0.4.3.x-final
Points: 0.5

comment:7 Changed 3 weeks ago by dgoulet

Owner: set to dgoulet
Status: newassigned
Note: See TracTickets for help on using tickets.