Opened 8 years ago

Last modified 4 years ago

#618 open enhancement

Linear search under lock in net.i2p.client.I2PSessionImpl2::receiveStatus(...)

Reported by: Zlatin Balevsky Owned by:
Priority: maintenance Milestone:
Component: api/i2cp Version: 0.8.13
Keywords: contention Cc:
Parent Tickets: Sensitive: no


the _sendingStates set gets locked and iterated under lock. There is a lot of logging around the monitors all over that class so someone must have considered this a problem.

I'll have a patch using O(1) lookups under the lock soon


Attachments (1)

I2PSessionImpl2.patch.zab (6.8 KB) - added by Zlatin Balevsky 8 years ago.
patch removing locks and adding msgId→MessageState? map

Download all attachments as: .zip

Change History (4)

Changed 8 years ago by Zlatin Balevsky

Attachment: I2PSessionImpl2.patch.zab added

patch removing locks and adding msgId→MessageState? map

comment:1 Changed 8 years ago by Zlatin Balevsky

I don't understand why is it possible at all to receive a message without a nonce but with a proper message id.

comment:2 Changed 8 years ago by zzz

Component: api/generalapi/i2cp
Priority: minormaintenance

As you noted the code for message states is pretty messy and old.

But as the javadoc for that method notes, it is almost always bypassed now because the streaming lib sets reliability=none.

So it's only used by datagram clients that haven't been updated to set reliability=none, which is probably only iMule.

That's why we haven't bothered to clean it up further. But the patch is still welcome.

comment:3 Changed 4 years ago by str4d

Status: newopen
Note: See TracTickets for help on using tickets.