[master] fb342dd document a potential race
Nils Goroll
nils.goroll at uplex.de
Mon Apr 30 11:51:16 UTC 2018
commit fb342dde523c3b87a62d2186422071311ae18fdd
Author: Nils Goroll <nils.goroll at uplex.de>
Date: Mon Apr 30 13:48:16 2018 +0200
document a potential race
closes #2625
diff --git a/bin/varnishd/cache/cache_tcp_pool.c b/bin/varnishd/cache/cache_tcp_pool.c
index 86777ae..fd416e8 100644
--- a/bin/varnishd/cache/cache_tcp_pool.c
+++ b/bin/varnishd/cache/cache_tcp_pool.c
@@ -667,6 +667,10 @@ VTP_Ref(const struct suckaddr *ip4, const struct suckaddr *ip6, const char *uds,
if (cp != NULL)
return (cp->priv);
+ /*
+ * this is racy - we could end up with additional pools on the same id /
+ * destination address with just a single connection
+ */
ALLOC_OBJ(tp, TCP_POOL_MAGIC);
AN(tp);
if (uds != NULL) {
More information about the varnish-commit
mailing list