Fix retrying when finding an available port for a Perforce stunnel.

Review Request #10942 — Created March 9, 2020 and submitted

Information

Review Board
release-3.0.x

Reviewers

When setting up stunnel for Perforce, we try to find an available local
port we can open for the local end of the tunnel. The intent of the
logic here was to keep trying until we've found some port, retrying any
time we hit an error trying to open one (usually a result of the port
already being opened).

The logic was flawed. We had the try/finally, but no except, meaning
that the first failure would bubble up out of the function. Retrying
never actually occurred.

This change fixes that, adding an empty except that just lets us
continue again. It also fixes up some bare except: lines, just to
satisfy linters.

Unit tests passed.

Summary ID
Fix retrying when finding an available port for a Perforce stunnel.
When setting up stunnel for Perforce, we try to find an available local port we can open for the local end of the tunnel. The intent of the logic here was to keep trying until we've found some port, retrying any time we hit an error trying to open one (usually a result of the port already being opened). The logic was flawed. We had the `try/finally`, but no `except`, meaning that the first failure would bubble up out of the function. Retrying never actually occurred. This change fixes that, adding an empty `except` that just lets us continue again. It also fixes up some bare `except:` lines, just to satisfy linters.
beb89bb170202f17922967be1cccaaf3e36b9fc3
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-3.0.x (1f3ad0c)