Concurrency issue with sending/establishing outbound S2S connection.

Description

There appears to be a concurrency issue that occurs when many stanzas (possibly from different threads) are being sent to a remote domain. The first stanza will cause an outgoing server session to be established. Right around the time that this session is established, the routing of another stanza seems to be able to trigger a nullpointer exception.

I've found the attached log file snippet on Ignite. You see my account join a chatroom, after which a large amount of push notifications are requested from p2.siacs.eu.

Just after a session to that domain is established, routing to that domain fails with a NullPointerException:

The corresponding code from RoutigTableImpl:

It appears that the serversCache.get(pair) invocation returns a non-null value, but the call to localRoutingTable.getRoute(pair) that follows, does return null.

I suspect that population of serversCache and localRoutingTable is not properly synchronized.

Environment

None

Attachments

1

Activity

Show:

Guus der Kinderen November 9, 2021 at 2:04 PM

There’s a good chance that the fix for reduces the impact of this bug (or prevents it from happening). I’m reducing the priority of this issue because of that. I do think that explicitly synchronizing things is still desired, so I’m not resolving this issue yet.

Fixed

Details

Assignee

Reporter

Fix versions

Priority

Created November 3, 2021 at 5:45 PM
Updated November 11, 2021 at 6:26 PM
Resolved November 11, 2021 at 6:26 PM