| 1 |
Source: python-ephemeral-port-reserve |
| 2 |
Section: python |
| 3 |
Priority: optional |
| 4 |
Maintainer: Debian Python Team <[email protected]> |
| 5 |
Uploaders: |
| 6 |
Thomas Goirand <[email protected]>, |
| 7 |
Build-Depends: |
| 8 |
debhelper-compat (= 11), |
| 9 |
dh-sequence-python3, |
| 10 |
openstack-pkg-tools, |
| 11 |
python3-all, |
| 12 |
python3-setuptools, |
| 13 |
Build-Depends-Indep: |
| 14 |
python3-pytest <!nocheck>, |
| 15 |
Standards-Version: 4.6.0 |
| 16 |
Vcs-Browser: https://salsa.debian.org/python-team/packages/python-ephemeral-port-reserve |
| 17 |
Vcs-Git: https://salsa.debian.org/python-team/packages/python-ephemeral-port-reserve.git |
| 18 |
Homepage: https://github.com/Yelp/ephemeral-port-reserve/ |
| 19 |
|
| 20 |
Package: python3-ephemeral-port-reserve |
| 21 |
Architecture: all |
| 22 |
Depends: |
| 23 |
${misc:Depends}, |
| 24 |
${python3:Depends}, |
| 25 |
Description: binds to an ephemeral port, force it into the TIME_WAIT state, and unbind it |
| 26 |
Sometimes you need a networked program to bind to a port that can't be |
| 27 |
hard-coded. Generally this is when you want to run several of them in |
| 28 |
parallel; if they all bind to port 8080, only one of them can succeed. |
| 29 |
. |
| 30 |
The usual solution is the "port 0 trick". If you bind to port 0, your kernel |
| 31 |
will find some arbitrary high-numbered port that's unused and bind to that. |
| 32 |
Afterward you can query the actual port that was bound to if you need to use |
| 33 |
the port number elsewhere. However, there are cases where the port 0 trick |
| 34 |
won't work. For example, mysqld takes port 0 to mean "the port configured in |
| 35 |
my.cnf". Docker can bind your containers to port 0, but uses its own |
| 36 |
implementation to find a free port which races and fails in the face of |
| 37 |
parallelism. |
| 38 |
. |
| 39 |
ephemeral-port-reserve helps you using port 0. |