pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/py-ephemeral_port_reserve net/py-ephemeral_port_re...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/5dd13d00d223
branches:  trunk
changeset: 378113:5dd13d00d223
user:      wiz <wiz%pkgsrc.org@localhost>
date:      Fri Apr 29 13:05:35 2022 +0000

description:
net/py-ephemeral_port_reserve: import py-ephemeral_port_reserve-1.1.4

Sometimes you need a networked program to bind to a port that can't
be hard-coded. Generally this is when you want to run several of
them in parallel; if they all bind to port 8080, only one of them
can succeed.

The usual solution is the "port 0 trick". If you bind to port 0,
your kernel will find some arbitrary high-numbered port that's
unused and bind to that. Afterward you can query the actual port
that was bound to if you need to use the port number elsewhere.
However, there are cases where the port 0 trick won't work. For
example, mysqld takes port 0 to mean "the port configured in my.cnf".
Docker can bind your containers to port 0, but uses its own
implementation to find a free port which races and fails in the
face of parallelism.

ephemeral-port-reserve provides an implementation of the port 0
trick which is reliable and race-free.

diffstat:

 net/py-ephemeral_port_reserve/ALTERNATIVES |   1 +
 net/py-ephemeral_port_reserve/DESCR        |  17 +++++++++++++++++
 net/py-ephemeral_port_reserve/Makefile     |  17 +++++++++++++++++
 net/py-ephemeral_port_reserve/PLIST        |  10 ++++++++++
 net/py-ephemeral_port_reserve/distinfo     |   5 +++++
 5 files changed, 50 insertions(+), 0 deletions(-)

diffs (70 lines):

diff -r a766989e2ef4 -r 5dd13d00d223 net/py-ephemeral_port_reserve/ALTERNATIVES
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/py-ephemeral_port_reserve/ALTERNATIVES        Fri Apr 29 13:05:35 2022 +0000
@@ -0,0 +1,1 @@
+bin/ephemeral-port-reserve @PREFIX@/bin/ephemeral-port-reserve-@PYVERSSUFFIX@
diff -r a766989e2ef4 -r 5dd13d00d223 net/py-ephemeral_port_reserve/DESCR
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/py-ephemeral_port_reserve/DESCR       Fri Apr 29 13:05:35 2022 +0000
@@ -0,0 +1,17 @@
+Sometimes you need a networked program to bind to a port that can't
+be hard-coded. Generally this is when you want to run several of
+them in parallel; if they all bind to port 8080, only one of them
+can succeed.
+
+The usual solution is the "port 0 trick". If you bind to port 0,
+your kernel will find some arbitrary high-numbered port that's
+unused and bind to that. Afterward you can query the actual port
+that was bound to if you need to use the port number elsewhere.
+However, there are cases where the port 0 trick won't work. For
+example, mysqld takes port 0 to mean "the port configured in my.cnf".
+Docker can bind your containers to port 0, but uses its own
+implementation to find a free port which races and fails in the
+face of parallelism.
+
+ephemeral-port-reserve provides an implementation of the port 0
+trick which is reliable and race-free.
diff -r a766989e2ef4 -r 5dd13d00d223 net/py-ephemeral_port_reserve/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/py-ephemeral_port_reserve/Makefile    Fri Apr 29 13:05:35 2022 +0000
@@ -0,0 +1,17 @@
+# $NetBSD: Makefile,v 1.1 2022/04/29 13:05:35 wiz Exp $
+
+DISTNAME=      ephemeral_port_reserve-1.1.4
+PKGNAME=       ${PYPKGPREFIX}-${DISTNAME}
+CATEGORIES=    net python
+MASTER_SITES=  ${MASTER_SITE_PYPI:=e/ephemeral_port_reserve/}
+
+MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=      https://github.com/Yelp/ephemeral-port-reserve/
+COMMENT=       Bind to ephemeral port, force it into TIME_WAIT state, and unbind it
+LICENSE=       mit
+
+post-install:
+       ${MV} ${DESTDIR}${PREFIX}/bin/ephemeral-port-reserve ${DESTDIR}${PREFIX}/bin/ephemeral-port-reserve-${PYVERSSUFFIX} || ${TRUE}
+
+.include "../../lang/python/egg.mk"
+.include "../../mk/bsd.pkg.mk"
diff -r a766989e2ef4 -r 5dd13d00d223 net/py-ephemeral_port_reserve/PLIST
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/py-ephemeral_port_reserve/PLIST       Fri Apr 29 13:05:35 2022 +0000
@@ -0,0 +1,10 @@
+@comment $NetBSD: PLIST,v 1.1 2022/04/29 13:05:35 wiz Exp $
+bin/ephemeral-port-reserve-${PYVERSSUFFIX}
+${PYSITELIB}/${EGG_INFODIR}/PKG-INFO
+${PYSITELIB}/${EGG_INFODIR}/SOURCES.txt
+${PYSITELIB}/${EGG_INFODIR}/dependency_links.txt
+${PYSITELIB}/${EGG_INFODIR}/entry_points.txt
+${PYSITELIB}/${EGG_INFODIR}/top_level.txt
+${PYSITELIB}/ephemeral_port_reserve.py
+${PYSITELIB}/ephemeral_port_reserve.pyc
+${PYSITELIB}/ephemeral_port_reserve.pyo
diff -r a766989e2ef4 -r 5dd13d00d223 net/py-ephemeral_port_reserve/distinfo
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/py-ephemeral_port_reserve/distinfo    Fri Apr 29 13:05:35 2022 +0000
@@ -0,0 +1,5 @@
+$NetBSD: distinfo,v 1.1 2022/04/29 13:05:35 wiz Exp $
+
+BLAKE2s (ephemeral_port_reserve-1.1.4.tar.gz) = 8f6af493ce79d9655a2a1eac52b026c977f868708f34110a88e83e3693cb070f
+SHA512 (ephemeral_port_reserve-1.1.4.tar.gz) = 7a406d092ddaeca28e55a6e0a367f10f21b635e3c32571b304453b86df0a852fb91a9b12619f300833ee58d6ef5aafcd7338801eeb7d330ad43c4f2caa14d50f
+Size (ephemeral_port_reserve-1.1.4.tar.gz) = 3541 bytes



Home | Main Index | Thread Index | Old Index