#2859 closed defect (invalid)

introducer client uses cache even if it doesn't have to

Reported by: dawuud Owned by:
Priority: minor Milestone: 1.12.1
Component: code-network Version: 1.12.0
Keywords: introducer Cc:
Launchpad Bug:

Description

Hello, I'm at 33c3 with str4d discussing the introducer client. He's report a connectivity ordering problem in #2858 however this also brought our attention to the currenct introducer client implementation: the introducer client connects to the cached storage servers even if the introducer is available. Is this a bug?

Shouldn't the introducer client try and fail to connect to the introducer before using the introducer cache and connecting to the cache storage node addresses?

Change History (6)

comment:1 Changed at 2016-12-29T19:55:38Z by dawuud

the introducer client's startService calls self._load_announcements() which loads the cache AND then calls _deliver_announcements which starts eventually connecting to all the storage nodes.

i could write a patch to fix this but i want to make sure it's the right thing to do. thoughts?

comment:2 Changed at 2016-12-29T20:10:07Z by warner

Huh. Looking at the code (IntroducerClient.startService), it looks like it will only read from the cache (_load_announcements) if a single getReference fails (via the errback to connect_failed). If that initial connection succeeds, there's no addCallback, so nothing will ever read from the cache.

Specifically, it looks like we start a Reconnector (tub.connectTo()), then immediately start a normal tub.getReference() to the same FURL. If/when the Reconnector succeeds, we'll eventually overwrite the cache file. If/when the normal connector *fails*, we'll load the cache.

Both of those are supposed to use the same connection attempt. I'm not sure which service will be startServiced first. If the Tub is running before IntroducerClient.startService is called, then the connectTo should create the outbound connection, and the getReference should wait for it to complete (success or failure). If the Tub isn't running by that point, then both connectTo and getReference will be queued, and then maybe the order in which they trigger outbound connections will be unpredictable. But the second one is still supposed to *not* start a second independent connection: it should see that a connection is already in progress, and attach itself to wait for the results of that one.

comment:3 Changed at 2016-12-29T20:17:36Z by warner

  • Component changed from unknown to code-network
  • Milestone changed from undecided to 1.12.1

comment:4 Changed at 2017-01-10T17:31:12Z by daira

  • Priority changed from normal to minor

comment:5 Changed at 2017-01-10T17:31:35Z by daira

  • Keywords introducer added

comment:6 Changed at 2017-01-13T00:06:56Z by dawuud

  • Resolution set to invalid
  • Status changed from new to closed

i was very sleepy at 33c3 when i was last looking at this and indeed i was mistaken.

Note: See TracTickets for help on using tickets.