We're updating the issue view to help you get more done. 

NIOConnection Thread Deadlock when two clients in each others roster simultaneously disconnect

Description

In testing the latest 3.10.0 Beta from the Github repository, a thread deadlock issue has been encountered.

The issue apparently occurs when two users, each with the other on their Roster, disconnect from the server at the same time.

Below is the relevant thread dump output for the deadlock situation:

-----------------------------------

-----------------------

-----------------------

A possible solution is to refactor the NIOConnection.close method, to invoke notifyCloseListeners() after the synchronized block. This is also how the method was arranged in Openfire versions at least as recent as 3.7.

Below is a refactored version of the method:

Environment

None

Acceptance Test - Entry

None

Activity

Show:
Tom Evans
November 13, 2015, 8:40 PM

Having another go at this one, based on this thread: https://community.igniterealtime.org/message/253342

Tom Evans
November 17, 2015, 12:00 AM

Submitted PR #374.

Daryl Herzmann
November 17, 2015, 5:13 PM

Tom, running 3.10 branch on Ignite and things seem to be OK. I do notice a fair number of these messages logged

At about a rate ~30 per hour.

Tom Evans
November 17, 2015, 6:19 PM

OK - that message indicates a "normal" error condition (dropped peer). Although benign, it should probably be a bit more helpful, and likely a debug message rather than an error. I will patch in the master branch for future release.

Tim Durden
January 7, 2016, 4:20 PM

Re-tested in Openfire 4.0.0 (nightly (5th Jan)) and could not replicate.

Note: Found jstack useful in assessing deadlock state:

Assignee

Tom Evans

Reporter

Daryl Herzmann

Labels

None

Expected Effort

None

Ignite Forum URL

None

Components

Fix versions

Affects versions

Priority

Blocker
Configure