mirror of
https://github.com/abh/geodns.git
synced 2026-04-27 03:45:53 +03:00
[GH-ISSUE #74] Panic on reenabling previously invalid zone #201
Labels
No labels
bug
bug
enhancement
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/geodns#201
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @abligh on GitHub (Aug 19, 2015).
Original GitHub issue: https://github.com/abh/geodns/issues/74
This crash is similar to #69 but with a different cause (and different fix)
To replicate:
dns/example.comso it is invalid (e.g. put anxat the top)geodnsdns/example.comso it is valid (e.g. remove the insertedx)geodnsto reloadexample.comdigquery for that zone e.g. todig A weight.example.com @....This produces a panic at:
on line 34 of
zone.go, because z.Metrics is{nil, nil, nil, nil}.This cause of this problem is that when the zone is first loaded,
Metricsis initialised to{nil, nil, nil, nil}.SetupMetricsis never called because the zone is invalid, but the old zone is kept around (presumably because in more complex circumstances it could have useful metrics in which should not be zeroed. When the zone is made loadable,oldis non-nil, so the previousMetricsstructis copied, but not initialised, so it remainsnil. The fix (coming right up) is to initialise anynilmembers of theMetricsstruct whatever the value ofoldon entry.Patch coming right up.
@abh commented on GitHub (Sep 6, 2015):
This was merged a few days ago.