Repository navigation
Poll for the duplicate reply in its test instead of waiting two seconds - #3306
Merged
Merged
Conversation
DL6ER
requested changes
Oct 26, 2026
DL6ER
left a comment
Member
There was a problem hiding this comment.
Required before approval: dnsmasq logs the duplicate line, and runs the FTL hook, only after send_from() to the second client, so the logs can be read too early. #3220 writes pihole.log from a separate thread, which widens this. Please poll for the line (up to a few seconds) instead of dropping the wait.
The test waited two seconds, as queries moved into the in-memory database once per second. Since pi-hole#3294 the query log reads them from shared memory, so a wait is only needed for the reply to the second query: dnsmasq answers that client first and only then runs the FTL hook and logs "reply query is duplicate". `_log_query()` calls `FTL_hook()` before it writes the line, so once the line is in pihole.log the hook has run as well. The test now polls pihole.log for that line, up to five seconds, with `pihole-FTL wait-for` from the size of the log before the queries. Signed-off-by: 010011110 <duckenheim@posteo.de>
010011110
force-pushed
the
duplicate-test-no-sleep
branch
from
October 26, 2026 20:56
8961110 to
d1160aa
Compare
Contributor
Author
|
done, squashed into one commit on top of current development: the test polls pihole.log for the duplicate line with wait-for, up to five seconds. _log_query() calls FTL_hook() before it writes the line, so the hook has run once the line is there, also with the writer thread of #3220 |
DL6ER
approved these changes
Oct 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this implement/fix?
as suggested in the review of #3296: its test waited two seconds for the queries to move into the in-memory database. since #3294 the query log reads them from shared memory, so the wait is only needed for the reply to the second query, which dnsmasq logs, and runs the FTL hook for, only after it has answered that client. the test now polls pihole.log for that line, up to five seconds, instead of sleeping
How to test the change during review
the test in test_final.bats, "The reply to a duplicate of a query in flight is not logged as an unknown reply"
Additional information
Related issue or feature (if applicable): #3296
Pull request in docs with documentation (if applicable): N/A
By submitting this pull request, I confirm the following:
git rebase)src/dnsmasq/. That tree is a verbatim copy of upstream dnsmasq and we do not carry anything in it that deviates from upstream. Fixes have to go through thednsmasq-discussmailing list first, we merge them once they are in dnsmasq master.Checklist:
developmentbranch.