Zandronum Chat on our Discord Server Get the latest version: 3.2
Source Code

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004175Zandronum[All Projects] Bugpublic2023-12-15 15:452023-12-15 15:45
Reportertautvis 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusnewResolutionopen 
PlatformLinuxOSLinuxOS Version6.5
Product Version3.1 
Target VersionFixed in Version 
Summary0004175: sv_updatemaster uses synchronous gethostbyname
Description

The the name `masterhostname` is resolved by directly calling gethostbyname function (in networkshared.cpp), which stall engine until dns resolution is done as it usually is up to few milliseconds time. But there are multiple cases when then time can be higher:
1) Using dns server which is not local, for example 8.8.8.8, 1.1.1.1 etc.., in my case for 8.8.8.8 request time is ~28ms, on 1.1.1.1 when cache is cold (all ttls expired) ~75ms!, but on hot case time <1ms
2) When DNS cache is cold and record ttl reached end of life (in master.zandronum.com is 300 seconds) - my local dns resolves ~28ms
3) dns packet is lost - stall ~2s (depends on system settings) + time for repeat request

On first glance does not look something worry as having multiple servers using same dns it would cause some very rare occasionally stutters. But if it is personal server with single zandronum instance it starts to be noticeable as persistent random stutters here and there when playing on local (i mean <10ms ping) network and if isp internet is down game starts to become unplayable (due to 2s timeout every 30seconds)


The quick remedy is to turn off master server update (set sv_updatemaster false).
Other remedies is set master server ip in /etc/hosts (or equivalent file) or use ip address in cvar instead hostname - but the price is to have periodically recheck if master server ip is changed as it defeats dns purpose...


for example dig report for 'unlucky' dns query for master.zandronum.com (it took 75msecs):

```
pc@pc ~ $ dig master.zandronum.com @1.1.1.1

; <<>> DiG 9.18.12 <<>> master.zandronum.com @1.1.1.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 53111
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;master.zandronum.com. IN A

;; ANSWER SECTION:
master.zandronum.com. 300 IN A 45.56.67.39

;; Query time: 75 msec
;; SERVER: 1.1.1.1#53(1.1.1.1) (UDP)
;; WHEN: Fri Dec xx xx:xx:xx EET 2023
;; MSG SIZE rcvd: 65

```


 
Steps To ReproduceStart game with master server update on.

a) Set dns server to something 8.8.8.8 or 1.1.1.1 - anything with longer ping, it is very noticeable on cacos (they start teleporting here and there);
b) Set non-existing dns server - that worst case and permanent 2secs lags every 30seconds;
c) start game normally and use firewall (probably on router) to block dns ip address;
Attached Files

- Relationships

-  Notes
There are no notes attached to this issue.

Issue Community Support
Only registered users can voice their support. Click here to register, or here to log in.
Supporters: No one explicitly supports this issue yet.
Opponents: No one explicitly opposes this issue yet.

- Issue History
Date Modified Username Field Change
2023-12-15 15:45 tautvis New Issue






Questions or other issues? Contact Us.

Links


Copyright © 2000 - 2025 MantisBT Team
Powered by Mantis Bugtracker