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

dnsmasq fix #208

Merged
merged 1 commit into from
Oct 8, 2021
Merged

dnsmasq fix #208

merged 1 commit into from
Oct 8, 2021

Conversation

maduggan
Copy link

to: @subspacecommunity/subspace-maintainers
related to:
resolves: #199

Background

Clients were reporting DNS timeouts every few hours with subspace, with the only resolution being to either restart the container or turn off DNS. Upon investigating, it seems subspace is using the wrong flag for dnsmasq, passing a debug flag instead of the approved production flag. This switches that. See: https://thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html

Debug mode: don't fork to the background, don't write a pid file, don't change user id, generate a complete cache dump on receipt on SIGUSR1, log to stderr as well as syslog, don't fork new processes to handle TCP queries. Note that this option is for use in debugging only, to stop dnsmasq daemonising in production, use --keep-in-foreground.

Changes

  • changes the flag from --no-daemon to -keep-in-foreground

Testing

root      4030  0.0  0.0    784     4 ?        Ss   11:49   0:00          \_ runsv dnsmasq
nfsnobo+  4036  0.0  0.0   2188  1692 ?        S    11:49   0:00          |   \_ /usr/sbin/dnsmasq --keep-in-foreground
$ docker-compose ps
  Name                Command               State   Ports
---------------------------------------------------------
subspace   /usr/local/bin/entrypoint. ...   Up
CONTAINER ID   IMAGE                                     COMMAND                  CREATED       STATUS          PORTS     NAMES
ad67ccc1ba2c   subspacecommunity/subspace:amd64-v1.5.0   "/usr/local/bin/entr…"   4 weeks ago   Up 3 weeks             subspace

Currently running a prolonged test with a few dozen users and so far everything looks good

@sonarcloud
Copy link

sonarcloud bot commented Sep 14, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@gchamon
Copy link

gchamon commented Sep 16, 2021

Please, keep us updated with the results from your prolonged test!

Nice catch, thanks!

Copy link

@gchamon gchamon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am pre-emptively approving this, because indeed the docs show --no-daemon being a DEBUG flag not suited for production. Still interested in seeing results from prolonged tests. @agonbar

@maduggan
Copy link
Author

@gchamon testing with about 30 daily users, all using subspace for dns. Went from requiring an hourly restart to not having restarted for two weeks. Glad to post any diagnostic logs since we’re also capturing those.

Copy link

@jfrede jfrede left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works fine seems to solve the Problem

@gchamon
Copy link

gchamon commented Oct 8, 2021

@jfrede good to know! thanks for the feedback

@agonbar
Copy link
Collaborator

agonbar commented Oct 8, 2021

Sorry for the long silence, I was a bit busy with life.

This looks awesome! I've suffered from this bug too. And the documentation also seems to back the change. I'm merging it. Many thanks @maduggan

@agonbar agonbar merged commit b96131f into subspacecommunity:master Oct 8, 2021
@agonbar
Copy link
Collaborator

agonbar commented Oct 8, 2021

@all-contributors please add @maduggan for code

@allcontributors
Copy link

@agonbar

I've put up a pull request to add @maduggan! 🎉

@annuh
Copy link

annuh commented Nov 30, 2021

We need to restart our Wireguard server from time to time to fix DNS issues. So thanks for this PR! Hopefully this will fix our issue as wel 🤞

Would it be possible to create a new release that includes this PR? v1.5.0...master

hbjlee17 added a commit to LunaNode/launchwg that referenced this pull request Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dnsmasq stopping abruptly
5 participants