Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
use same parameter for DNS.allocate_request_id/free_request_id to fix leak #5722
As described in logstash-plugins/logstash-filter-dns#52
This problem will only be triggered if there are multiple nameserver hosts specified OR if there is no nameserver host but there are more than one host in
Essentially the problem is that the
But the cache cleanup will be done in the
This fix just makes sure that the exact same parameters are used in both
I am planning on submitting this issue upstream in Ruby but I figured I'd also submit here to provide a potential quicker turnaround for this nasty bug.
@colinsurprenant Ah yes, @enebo refreshed my memory. So I believe #4496 was because our IPAddr and related structures were not quite matching CRuby...just another part of the complicated socket subsystem that we're not emulating exactly right. But things have changed in the meantime and a whole bunch of socket compat fixes got merged in within the last two years...we might be ok?
Updating some details on my own...
The patch that @colinsurprenant proposes here does make our resolv.rb diverge further from the CRuby version. However the bug is caused by a separate divergence, and this just fixes that patch to work better.
If I'm understanding correctly, the change introduced in #4496 causes this to break because the
So I think the patch is is fine; the fix in #4496 was incomplete in that it only used the processed host along one path.