Current behavior is to release requester and resolution right after DNS
resolution, which prevents DNS caching to happen. Instead, keep the
requester and rely on "hold valid" timeout to update the resolution as
expected and stream cleanup code to release structures, effectively
allowing another stream resolving the same FQDN to reuse the resolution
if it is still valid (the "cache").
This should be backported on all supported versions as a test version
compiled from the commit introducing the cache (7264dfe) confirms it
doesn't work, as the structures were already released too early.
---
 src/resolvers.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/resolvers.c b/src/resolvers.c
index 6daee3e14..b90e665e7 100644
--- a/src/resolvers.c
+++ b/src/resolvers.c
@@ -3132,6 +3132,7 @@ enum act_return resolv_action_do_resolve(struct act_rule 
*rule, struct proxy *px
                                        smp.strm = s;
 
                                        
vars_set_by_name(rule->arg.resolv.varname, strlen(rule->arg.resolv.varname), 
&smp);
+                                       goto end;
                                }
                        }
                }
-- 
2.43.0


Reply via email to