Deadlock during Smack disconnect

Description

The scenario occurs as follows, Calling disconnect attempts to close the connections reader, (line 528) which attempts to acquire the readers lock. This reader is also held by the MXParser, which at the time of the close is blocked reading from the socket. This blocked read is holding the reader lock and thus deadlocks the close call. There is an attempt to shutdown the PacketReader (line 570), but as shutdown waits for the current operations to finish, the blocked read is not interrupted and the call to close will hang.

Reported and a suggestion on how to fix it on http://www.igniterealtime.org/community/message/178842#178842

Environment

None

Attachments

2

Activity

Show:

Florian Schmaus 
January 6, 2013 at 2:09 PM

Florian Schmaus 
January 5, 2013 at 1:58 PM

Prepared smack-278 branch at https://github.com/flowdalic/smack/tree/smack-278
Use 'git diff upstream smack-278' to view the changes.

Kir Maximov 
December 19, 2012 at 3:24 PM

Hello,

Is there any progress on this issue? Would be glad to see a fix integrated into Smack trunk.

Thanks,

Kir Maximov 
September 17, 2012 at 8:48 AM

Hi,

Here is a related problem, which should be fixed by the patch, I suppose: http://community.igniterealtime.org/message/224748#224748

Thanks,
KIR

Kare Nuorteva 
October 27, 2011 at 10:29 AM

Version 2

Minor improvement:

  • Handle closing socket if socket shutdown fails.

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

Created September 22, 2009 at 10:03 PM
Updated May 30, 2013 at 10:43 PM
Resolved January 6, 2013 at 2:09 PM