Opened 7 years ago

Last modified 3 years ago

#618 open enhancement

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

Reported by: zab Owned by:
Priority: maintenance Milestone:
Component: api/i2cp Version: 0.8.13
Keywords: contention Cc:
Parent Tickets:

Description

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

Subtickets (add)

Attachments (1)

I2PSessionImpl2.patch.zab (6.8 KB) - added by zab 7 years ago.
patch removing locks and adding msgId->MessageState? map

Download all attachments as: .zip

Change History (4)

Changed 7 years ago by zab

patch removing locks and adding msgId->MessageState? map

comment:1 Changed 7 years ago by zab

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

  • Component changed from api/general to api/i2cp
  • Priority changed from minor to maintenance

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 3 years ago by str4d

  • Status changed from new to open
Note: See TracTickets for help on using tickets.