Bug #4753
closed[API/Keep] Establish separate development/testing ports for Keep and Websockets
Updated by Tom Clegg over 7 years ago
- Category set to Tests
- Status changed from New to In Progress
- Assigned To set to Tom Clegg
- Target version changed from Arvados Future Sprints to 2016-07-06 sprint
4753-websocket-test-port @ c368406
Updated by Radhika Chippada over 7 years ago
The only concern is that is is possible the same port number can be returned by the following code if two different clients tried to get an available port before the passenger start is executed by one of those clients to use up that port. May be it is so rare and unlikely that we can live with it?
s = TCPServer.new('0.0.0.0', 0) WEBSOCKET_PORT = s.addr[1] s.close SERVER_PID_PATH = "tmp/pids/passenger.#{WEBSOCKET_PORT}.pid"
Other than that, LGTM.
Updated by Tom Clegg over 7 years ago
Radhika Chippada wrote:
The only concern is that is is possible the same port number can be returned by the following code if two different clients tried to get an available port before the passenger start is executed by one of those clients to use up that port. May be it is so rare and unlikely that we can live with it?
Yes, I think we just have to live with this possibility. The "select available port" implementation (in linux at least) is randomized, so even in a race it's unlikely two processes will choose the same one.
We might be able to tell passenger to use port zero, and figure out which one it used by reading its logs or something, but it doesn't seem worth the effort at this point...
Updated by Radhika Chippada over 7 years ago
Sounds good to live with it. Thanks.
Updated by Tom Clegg over 7 years ago
- Assigned To deleted (
Tom Clegg) - Target version deleted (
2016-07-06 sprint)
Updated by Tom Clegg over 7 years ago
- Status changed from In Progress to Resolved