Skip to content
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

The query log refreshes itself, goes back to the beginning and into the future ! #2293

Closed
3 tasks done
mgcWil opened this issue Nov 11, 2020 · 14 comments
Closed
3 tasks done
Assignees
Milestone

Comments

@mgcWil
Copy link

mgcWil commented Nov 11, 2020

Prerequisites

Please answer the following questions for yourself before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.

  • I am running the latest version (0.104.0)
  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed

Issue Details

  • Version of AdGuard Home server:
    • 0.104.0
  • How did you setup DNS configuration:
  • If it's a router or IoT, please write device model:
  • Operating system and version:
    • Behaviors observed on two different Windows 10 machines, Firefox 81.0.2

Expected Behavior

Actual Behavior

Hello!
I also notice strange behaviors of the query log which can go in an infinite loop without using the mouse wheel, refresh itself completely by itself and go back to the beginning, making any progress impossible !

I also notice inconsistencies in the chronology, sometimes the following lines indicate a more recent time !

My AGH is incrementing a TXT log, non verbose, I found many lines with "[error] Couldn't find timestamp:".
I finally noticed that this incrementing is done when consulting the query log with the scroll wheel, see the screenshots.

Screenshots

Screenshot:

"Back to the future !"

Scroll_of_Log_capture_1 93
Scroll_of_Log_capture_2 150
Scroll_of_Log_capture_3 247
Scroll_of_Log_capture_4 361

Real-time incrementing of the TXT journal with lines "[error] Couldn't find timestamp:"

Bug_Query_Log_view_txt

Infinite loop without using the mouse wheel, the scrollbar or the keyboard !

Scroll_Auto_of_Query_Log

Additional Information

I had noticed these problems with the beta 0.104.0-beta3, and found that the query log could not be exploitable, seeing that the navigation buttons had disappeared in the version 0.104.0, I thought that the bugs had been fixed...

For me, it's back to 0.103.0, whose query log has some problems too, but less catastrophic.

I wanted to bring my little contribution, especially in image and my feeling.

I do not doubt that a solution will be found, I hope quickly (but I will be patient) in the form of a patch on this version 0.104 ? Maybe, in the meantime ; good work to all and thank you ;)

@ameshkov
Copy link
Member

My AGH is incrementing a TXT log, non verbose, I found many lines with "[error] Couldn't find timestamp:".

Please check the "edge" channel build, this issue has been fixed there.

@ameshkov ameshkov added the duplicate Duplicate or merged issues. label Nov 11, 2020
@mgcWil
Copy link
Author

mgcWil commented Nov 11, 2020

version v0.104.0-SNAPSHOT-3cc5bf21 installed in another folder, started (without data folder), and tested :
1- The lines "[error] Couldn't find timestamp:" don't appear in the TXT log, OK,
2- but the inconsistencies in the chronology still exist :(
Scroll_of_Log_capture_5-6-7-8
3- The query log has completely refreshed to go back to the beginning as soon as the end (or rather the beginning) of the records reached !
:(

@ameshkov ameshkov added bug P3: Medium and removed duplicate Duplicate or merged issues. labels Nov 11, 2020
@ameshkov ameshkov added this to the v0.105 milestone Nov 11, 2020
@ameshkov ameshkov reopened this Nov 11, 2020
@ainar-g
Copy link
Contributor

ainar-g commented Nov 11, 2020

Hi! The query log fix landed after that snapshot. Please try the newly released v0.104.1, it should fix that issue.

@mgcWil
Copy link
Author

mgcWil commented Nov 11, 2020

Well, v0.104.1 installed (update from v0.104.0), started (without data folder), and tested :
Positive points :
1- The lines "[error] Couldn't find timestamp:" really don't appear in the TXT log anymore, cool !
2- The query log did NOT refresh completely to go back to the beginning as soon as the end (or rather the beginning) of the records reached, cool again !

But, the negative point: The inconsistencies in the chronology still exist, not cool, arf :(

Scroll_of_Log_capture_10-11

@ameshkov
Copy link
Member

The query is written to the log when it has been processed (so they are ordered by "end time"). But the time you're seeing in the log is the time when the query processing has been started.

@mgcWil
Copy link
Author

mgcWil commented Nov 11, 2020

Okay, I didn't know that. It's hard to take in, but I get it.
So it's not a bug at all ?
To avoid misunderstandings, and improve readability, wouldn't it be simpler if the log shows us the "end time", just ?

@ameshkov
Copy link
Member

Yeah, that's generally not a bug, but there are ways to mitigate this.

@mgcWil
Copy link
Author

mgcWil commented Nov 11, 2020

OK, so the query log shows us the time at which the processing of the request was launched (the demand), classifying these requests by order of processing (the response), did I understand correctly ?

By saying "there are ways to mitigate this" what do you mean ?
1- that response times can be improved ? On the AGH side, Upstream... (my self-esteem just took a hit there :) )
2- that the query log could display requests by processing order only (the response), or the reverse (but it might be less relevant, my moldy Upstreams have random response times) ? And here it concerns you, the coders, AH ! (My ego is already better there !)
3- one or other ways ?

What's up?
Take the time to answer me, there's no hurry, there's no bug (just my bad Upstreams and a strange query log...) !
;)

@ameshkov
Copy link
Member

The queries are buffered in-memory before they're dumped into the query log file. We could keep them sorted at that point. There's still a probability that the query that's processed right after the buffer is dumped will get out of sort.

@mgcWil
Copy link
Author

mgcWil commented Nov 12, 2020

OK, I understand that here you are expressing that you could make an improvement ?

I will persist in the Bug !
I made a short extraction from the query log, keeping only the "Time" column, then numbered in chronological order each displayed line. Using a simple formula in a spreadsheet, I wanted to highlight the time differences.
The result is :

  • that the time differences between two rows are more than a few seconds.
  • that the log sometimes displays identical time ranges, loops, several times.

No screenshot this time, but two XLSX.
Copie_Query_Log.xlsx
Copie_Query_Log_local.xlsx

@ameshkov
Copy link
Member

Maybe. We're planning to take a deeper look into it anyway so your input would be useful.

@mgcWil
Copy link
Author

mgcWil commented Nov 12, 2020

Great 👍
Here's another extraction, at a different time, the results are identical to the first one.
Copie_Query_Log_local_2.xlsx

I wanted to make another one from the query log of the first machine, but I couldn't do it !
AGH has been running since 19H yesterday, it hasn't restarted since, and the query log doesn't show me anything before 14:02:44 today on the "All queries" filtering. On the other hand, it goes further with the "Processed" filtering !
Damn animal !

Query_Log_Stop_Charg

Thank you !

adguard pushed a commit that referenced this issue Nov 30, 2020
Merge in DNS/adguard-home from 2293-log-sort to master

Updates #2293.

Squashed commit of the following:

commit f8961e5
Author: Ainar Garipov <[email protected]>
Date:   Sat Nov 28 17:19:15 2020 +0300

    all: document changes

commit c92c533
Author: Ainar Garipov <[email protected]>
Date:   Sat Nov 28 16:44:01 2020 +0300

    querylog: resort buffers
@ainar-g
Copy link
Contributor

ainar-g commented Nov 30, 2020

We've added a small mitigation in snapshot 6e615c6. Unfortunately, we will probably only be able to fix the issue after #2290 is solved.

@ainar-g ainar-g modified the milestones: v0.105, v0.106 Nov 30, 2020
adguard pushed a commit that referenced this issue Dec 10, 2020
Merge in DNS/adguard-home from 2293-log-sort to master

Updates #2293.

Squashed commit of the following:

commit f8961e5
Author: Ainar Garipov <[email protected]>
Date:   Sat Nov 28 17:19:15 2020 +0300

    all: document changes

commit c92c533
Author: Ainar Garipov <[email protected]>
Date:   Sat Nov 28 16:44:01 2020 +0300

    querylog: resort buffers
@ainar-g
Copy link
Contributor

ainar-g commented Apr 8, 2021

We will close this issue now, as there will be a lot more work done to make the query log more reliable in #2554.

@ainar-g ainar-g closed this as completed Apr 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants