Bug 487472 - Disconnect doesn't close _sockpairR/W
Summary: Disconnect doesn't close _sockpairR/W
Status: UNCONFIRMED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Paho.MQTT-Python (show other bugs)
Version: unspecified   Edit
Hardware: Other Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Roger Light CLA
QA Contact: Project Inbox CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-08 15:36 EST by John Nill CLA
Modified: 2016-07-22 14:58 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Nill CLA 2016-02-08 15:36:49 EST
The socket connections _sockpairR and _sockpairW do not appear to be closed on disconnect (or ever except for reinitialize()).  This caused an issue where the list of valid socket descriptors built up until the outgoing communication socket could not be established to send or receive messages.  This became an issue when rapidly attempting to connect and disconnect from the same broker repeatedly.

The issue was resolved by explicitly calling client._sockpairR.close() and client._sockpairW.close() within the on_disconnect callback.  After doing this, the file descriptors were properly disposed of and connections would no longer become blocked after ~1024 connections.

Additional notes:
The Linux distribution was cedar-14 Ubuntu running on Heroku (1 dyno).  Python version is 2.7.11.

Order of execution:
connect
loop start
subscribe
publish
receive response
unsubscribe
loop stop
disconnect
(on disconnect) close sockpair.

Let me know if there is any additional information i can supply.