-
Notifications
You must be signed in to change notification settings - Fork 921
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dnsdist: add pooling support for RemoteLoggerInterface
#15123
base: master
Are you sure you want to change the base?
Conversation
There is a lot of noise in |
Can you split this work in two commits, one with most of the formatting/whitespace changes and another with the actual work? This would indeed help reviewing. |
This adds a new kind of `RemoteLoggerInterface`: `RemoteLoggerPool`. It can take multiple other `RemoteLoggerInterface`s and pass data to them in round-robin order by default. This also adds additional option to `newRemoteLogger`, `newFrameStreamTcpLogger` and `newFrameStreamUnixLogger`: `connectionCount`, which can be used to generate a pool with multiple connections. Closes: PowerDNS#14861
Co-authored-by: Miod Vallat <[email protected]>
01d1012
to
95fb88b
Compare
Pull Request Test Coverage Report for Build 13237466080Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
Co-authored-by: Miod Vallat <[email protected]>
Can't comment about the usefulness, but the code reads ok. Can you update the meson rules so that the CI gets a chance to pass? |
Thank you. I went for a very simple approach for now. There was a discussion of different strategies (for picking the interface(s) to pass data to), but I think these are easy to add onto this, since it really just forwards data to one of the interfaces. |
This also fixes a bug with loggers in YAML, which had hardcoded connection status. For `RemoteLogger` that worked by having it always connect, but for `FrameStreamLogger` it never connected. Now the behavior is the same as lua, by checking the client mode flag.
There was not option of having no alter function defined, even though it is expected by config. If it wasn't defined, it passed an invalid alter function into the action. This makes the alter function optional and properly checks if it was found in configuration.
One concern, though, is that |
You are right. I have overlooked that. I can see that |
Also, I was wondering if I should change the implementation of The alternative would be to just show number of loggers and stats, but then that would hide the addresses. This also brings me to the |
I think a short summary, perhaps with aggregated metrics, would be fine. Something like "Pool of {number} remote loggers" plus the metrics?
Yeah, that's fine by me.
As far as I can tell |
6ae9361
to
3a05381
Compare
I have added some basic tests for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One tiny nit, but the PR looks good to me, nice work!
Thank you! Do you think tests for other types of loggers are needed? The pool should work the same for all of them, so not sure if it is worth it to add more tests. |
Co-authored-by: Remi Gacogne <[email protected]>
I'm always surprised by how many things that should work the same actually break at some point :) My own experience is that everything that is not tested is at best temporarily working, until it gets broken and no-one notices! So if it's easy to test the other cases I would love the extra tests, but I'm also fine with merging this PR as it is, or even adding the tests myself. |
It should be fairly easy to add in the other tests too, if this one turns out okay, so I could add these too if you want. |
If you don't mind it would be awesome, but I'm also OK with merging this PR as it is. |
I had some issues with tests for the |
Short description
This adds a new kind of
RemoteLoggerInterface
:RemoteLoggerPool
. It can take multiple otherRemoteLoggerInterface
s and pass data to them in round-robin order by default.This also adds additional option to
newRemoteLogger
,newFrameStreamTcpLogger
andnewFrameStreamUnixLogger
:connectionCount
, which can be used to generate a pool with multiple connections.Closes: #14861
Checklist
I have: