Project

General

Profile

Actions

Bug #4753

closed

[API/Keep] Establish separate development/testing ports for Keep and Websockets

Added by Brett Smith over 9 years ago. Updated about 7 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
-
Category:
Tests
Target version:
-
Story points:
-

Subtasks 1 (0 open1 closed)

Task #9533: Review 4753-websocket-test-portClosedTom Clegg07/01/2016Actions
Actions #1

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

Actions #2

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.

Actions #3

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...

Actions #4

Updated by Radhika Chippada over 7 years ago

Sounds good to live with it. Thanks.

Actions #5

Updated by Tom Clegg over 7 years ago

  • Assigned To deleted (Tom Clegg)
  • Target version deleted (2016-07-06 sprint)
Actions #6

Updated by Tom Clegg over 7 years ago

  • Status changed from In Progress to Resolved
Actions

Also available in: Atom PDF