Opened 9 years ago

Closed 9 years ago

#659 closed defect (fixed)

Hang on startup caused by I2PSessionImpl._leaseSet

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


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 (7)

comment:1 Changed 9 years ago by Zlatin Balevsky

Same goes for I2PSessionImpl._opening

comment:2 Changed 9 years ago by Zlatin Balevsky

And I2PSessionImpl._closed

comment:3 Changed 9 years ago by Zlatin Balevsky

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 9 years ago by Zlatin Balevsky

Component: unspecifiedrouter/general

comment:5 Changed 9 years ago by Zlatin Balevsky

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 9 years ago by zzz

Component: router/generalapi/i2cp
Owner: set to zzz
Priority: majorminor
Status: newaccepted

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 9 years ago by zzz

Resolution: fixed
Status: acceptedclosed

_dateReceived set to volatile in 0.9.1-3.

Note: See TracTickets for help on using tickets.