Opened 7 years ago

Closed 7 years ago

#659 closed defect (fixed)

Hang on startup caused by I2PSessionImpl._leaseSet

Reported by: zab Owned by: zzz
Priority: minor Milestone: 0.9.2
Component: api/i2cp Version: 0.9
Keywords: volatile hang Cc:
Parent Tickets:

Description

net.i2p.client.I2PSessionImpl._leaseSet needs to be volatile or thread-safe in some other way. I can occasionally reproduce a hang on startup where my client tunnel builder thread never receives a _leaseSet and never starts eeProxy.

Subtickets

Change History (7)

comment:1 Changed 7 years ago by zab

Same goes for I2PSessionImpl._opening

comment:2 Changed 7 years ago by zab

And I2PSessionImpl._closed

comment:3 Changed 7 years ago by zab

And I2PSessionImpl._dateReceived. All fields in that class that are using wait()-ing on some object during connect() are using broken synchronization pattern and could potentially miss updates and hang.

comment:4 Changed 7 years ago by zab

  • Component changed from unspecified to router/general

comment:5 Changed 7 years ago by zab

I was able to reproduce this even after making the fields volatile. Looks like it's caused by a actually not receiving a lease set on startup. Still, the fields should be volatile.

This is very annoying for new users because it causes eeproxy to not work until after 5 minutes of uptime or so. Perhaps the timeouts or aggressiveness could be tweaked?

comment:6 Changed 7 years ago by zzz

  • Component changed from router/general to api/i2cp
  • Milestone changed from 0.9.1 to 0.9.2
  • Owner set to zzz
  • Priority changed from major to minor
  • Status changed from new to accepted

opening and closed changed to volatile just before the 0.9.1 release. Didn't see the _dateReceived comment before the release.

Never really thought that volatile was the cause of the leaseset problem. Volatile never solved any reproducible problem I've ever had. Not that I'm arguing with doing things right.

If you can't get a LeaseSet? (i.e. build one inbound and outbound tunnel), then you have serious problems - either a lack of peers, or very stale peers in your netdb, or no internet, or a severely congested internet connection. We can't prevent all cases. And anyway, i2ptunnel retries, so the 5 minute give-up isn't fatal.

Leaving open to make _dateReceived volatile.

comment:7 Changed 7 years ago by zzz

  • Resolution set to fixed
  • Status changed from accepted to closed

_dateReceived set to volatile in 0.9.1-3.

Note: See TracTickets for help on using tickets.