-
-
Notifications
You must be signed in to change notification settings - Fork 233
Do not restart FTL while pihole -g is still ongoing
#2419
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
base: development
Are you sure you want to change the base?
Conversation
|
Why are we offering the Im not sure if this is the right way to fix #2395 - maybe the external program should simply call |
Yes
Yes, but my point here is that - as long as we are offering this - this can very well be considered a bug as FTL can be brought into a (temporary, but maybe long) defunct state until gravity finishes it can finally restart |
yubiuser
left a comment
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.
It causes some logspam
2025-04-06 21:31:59.322 CEST [135290/T135309] INFO: Not restarting as gravity is still running...
2025-04-06 21:32:00.323 CEST [135290/T135309] INFO: Not restarting as gravity is still running...
2025-04-06 21:32:01.322 CEST [135290/T135309] INFO: Not restarting as gravity is still running...
2025-04-06 21:32:02.323 CEST [135290/T135309] INFO: Not restarting as gravity is still running...
2025-04-06 21:32:03.324 CEST [135290/T135309] INFO: Not restarting as gravity is still running...
2025-04-06 21:32:04.325 CEST [135290/T135309] INFO: Not restarting as gravity is still running...
2025-04-06 21:32:05.325 CEST [135290/T135309] INFO: Not restarting as gravity is still running...
2025-04-06 21:32:06.326 CEST [135290/T135309] INFO: Not restarting as gravity is still running...
2025-04-06 21:32:07.327 CEST [135290/T135309] INFO: Not restarting as gravity is still running...
2025-04-06 21:32:08.328 CEST [135290/T135309] INFO: Not restarting as gravity is still running...
2025-04-06 21:32:09.328 CEST [135290/T135309] INFO: Not restarting as gravity is still running...
2025-04-06 21:32:10.329 CEST [135290/T135309] INFO: Not restarting as gravity is still running...
2025-04-06 21:32:11.329 CEST [135290/T135309] INFO: Not restarting as gravity is still running...
2025-04-06 21:32:12.330 CEST [135290/T135309] INFO: Not restarting as gravity is still running...
2025-04-06 21:32:13.332 CEST [135290/T135309] INFO: Not restarting as gravity is still running...
2025-04-06 21:32:13.641 CEST [135290/T135558] INFO: Restarting FTL: API action request
2025-04-06 21:32:13.642 CEST [135290M] INFO: Asked to terminate by "/usr/bin/pihole-FTL -f" (PID 135290, user pihole UID 999)
2025-04-06 21:32:13.642 CEST [135290M] INFO: Not restarting as gravity is still running...
2025-04-06 21:32:14.331 CEST [135290/T135309] INFO: Not restarting as gravity is still running...
2025-04-06 21:32:15.332 CEST [135290/T135309] INFO: Not restarting as gravity is still running...
2025-04-06 21:32:16.332 CEST [135290/T135309] INFO: Not restarting as gravity is still running...
2025-04-06 21:32:17.333 CEST [135290/T135309] INFO: Not restarting as gravity is still running...
__
This is working as expected, but something very 'gravity' specific. Shouldn't this be extended to all endpoints - only restart when the previous requests have been finished?
|
Sorry, seeing your reply only now. The gravity case is very special here because it is (really!) long-lived and can prevent FTL from shutting down. Is there any other action that is capable of doing something similar? I don't think so. We can surely reduce the logging to do it ... once and then again every 30 seconds if still waiting? ... |
Yes please. And more importantly: Only start logging when gravity is running and a restart request has been received. As you can see in the log above the logging started when the gravity endpoint has been requested, and only 14 seconds later the restart requests was received. |
|
I think this needs some attention from @DL6ER. I added some review points
|
|
Added. I also just have seen your comment on #5815 and I don't actually think so. All this PR is doing is ensuring the DNS server is not shut down too early. The gravity process will - in any case be finished. Having said that, I did just see a possible evasion of this: Assume the gravity runs really long (think minutes). DNS operation has stopped. Users may log in via SSH and force a restart of FTL using However, even in this case, I don't think users will end up with a broken database as the gravity process has been designed to avoid this. We are always working on a temporary file the entire time until we swap the files at the very end. This should be an almost atomic operation and the likeliness that the process is interrupted at this very point seems ultra-low to me. But I may of course be wrong about this. |
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
…ing. This to prevent being stuck in a situation where FTL has shut down 99% and cannot serve DNS until pihole -g finished running Signed-off-by: DL6ER <[email protected]>
…ost every 30 seconds Signed-off-by: DL6ER <[email protected]>
b503db3 to
9281118
Compare
|
Conflicts have been resolved. |
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Signed-off-by: Dominik <[email protected]>
|
Conflicts have been resolved. |
yubiuser
left a comment
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.
I'm not sure how I tested it last time, but now I tried it with two approaches and it killed gravity right away without printing any warning or waiting for gravity.
- Triggered gravity from the web interface, then re-started resolver from Settings/System.
- Triggered gravity from the web interface, then changed a setting that required a FTL restart
|
@yubiuser Did you meant to submit this as request for changes? If so, I'm not seeing an actual request. |
|
Yes it is. The request is to make it work. Currently, a running gravity is killed without waiting when a FTL restart is triggered |
Signed-off-by: Dominik <[email protected]>
yubiuser
left a comment
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.
2025-10-05 11:50:32.551 CEST [172358/T172828] INFO: Restarting FTL: API action request
2025-10-05 11:50:32.552 CEST [172358M] INFO: Asked to terminate by "/usr/bin/pihole-FTL -f" (PID 172358, user pihole UID 999)
2025-10-05 11:50:32.552 CEST [172358M] INFO: Not terminating as gravity is still running...
2025-10-05 11:51:03.959 CEST [172358/T172818] INFO: Not terminating as gravity is still running...
2025-10-05 11:51:34.975 CEST [172358/T172818] INFO: Not terminating as gravity is still running...
2025-10-05 11:51:42.033 CEST [172358/T172820] INFO: Terminating timer thread
2025-10-05 11:51:42.044 CEST [172358/T172817] INFO: Terminating database thread
2025-10-05 11:51:42.329 CEST [172358M] INFO: Finished final database update
2025-10-05 11:51:42.330 CEST [172358M] INFO: Waiting for threads to join
2025-10-05 11:51:42.330 CEST [172358M] INFO: Thread housekeeper (1) is idle, terminating it.
2025-10-05 11:51:42.330 CEST [172358M] INFO: Thread dns-client (2) is idle, terminating it.
|
RISCV is constantly failing. Maybe needs a rebase/merge of development to include #2631 |
|
Merged latest |
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Signed-off-by: Dominik <[email protected]>
|
Conflicts have been resolved. |

What does this implement/fix?
Do not try to restart FTL when a streamed
pihole -grun is still ongoing. This to prevent being stuck in a situation where FTL has shut down 99% and cannot serve DNS untilpihole -gfinished running.Related issue or feature (if applicable): Fixes #2395
Pull request in docs with documentation (if applicable): N/A
By submitting this pull request, I confirm the following:
git rebase)Checklist:
developmentalbranch.