I2P

Invisible Internet Project


Ticket #659 (closed defect: fixed)

Opened 12 months ago

Last modified 11 months ago

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:

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.

Change History

Changed 12 months ago by zab

Same goes for I2PSessionImpl._opening

Changed 12 months ago by zab

And I2PSessionImpl._closed

Changed 12 months 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.

Changed 12 months ago by zab

  • component changed from unspecified to router/general

Changed 11 months 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?

Changed 11 months ago by zzz

  • owner set to zzz
  • priority changed from major to minor
  • status changed from new to accepted
  • component changed from router/general to api/i2cp
  • milestone changed from 0.9.1 to 0.9.2

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.

Changed 11 months ago by zzz

  • status changed from accepted to closed
  • resolution set to fixed

_dateReceived set to volatile in 0.9.1-3.

Note: See TracTickets for help on using tickets.