circus-tent / circus

A Process & Socket Manager built with zmq
http://circus.readthedocs.org/
Other
1.55k stars 258 forks source link

Add retry when arbiter start failed in tests #1185

Closed tinylambda closed 2 years ago

tinylambda commented 2 years ago

We can't use close to release the port resource. The close function just decrease the reference count and the actual cleanup is performed by the OS.

In our test cases:

  1. we create a socket and and
  2. bind it to a port selected by OS kernel
  3. extract the port from the socket and then return it
  4. close the socket 5. we assume that the port resource is available

We cannot ensure the fifth expectation is true, because the release of the port is not performed by the close function, it's released by the system when it sees the reference count to this socket is zero.

So, we must add some machanism to wait for the system releasing the port resource.

@k4nar