SeattleTestbed / attic

ARCHIVAL: Full mirror of SeattleTestbed's SVN in early 2014. We use GitHub since!
MIT License
0 stars 1 forks source link

nmclient.repy race condition when using sockettimeout #1324

Closed choksi81 closed 10 years ago

choksi81 commented 10 years ago

The following lines are susceptible to race conditions, where multiple threads call _getusableport() simultaneously.

https://seattle.poly.edu/browser/seattle/branches/repy_v2/seattlelib/nmclient.repy#L114

https://seattle.poly.edu/browser/seattle/branches/repy_v2/seattlelib/nmclient.repy#L188

My proposed solution is to not attempt to find a port at all, and let sockettimeout find the port to use for us, as it iterates through all the ports, trying to open a connection with each one.

choksi81 commented 10 years ago

Attachments: https://github.com/SeattleTestbed/attic/blob/master/TICKET_ATTACHMENTS/nmclient.repy.patch