Closed choksi81 closed 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.
Attachments: https://github.com/SeattleTestbed/attic/blob/master/TICKET_ATTACHMENTS/nmclient.repy.patch
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.