[GH-ISSUE #8] Closes UDP socket randomly(?) #152

Closed
opened 2026-03-01 17:24:13 +03:00 by kerem · 5 comments
Owner

Originally created by @abh on GitHub (Aug 31, 2012).
Original GitHub issue: https://github.com/abh/geodns/issues/8

This is a followup to miekg/dns#21 (which really was about something else).

I ran dnsbench against the geodns server today to reproduce the "hang" where it just stops listening on UDP. After 4 hours of 1000qps it was still working fine and it's "only" doubled memory usage from 15MB to 30MB.

Running lsof on the process shows it's doesn't have the UDP server open anymore.

I've added some monitoring code in 70b6e4e413 and an attempt at logging if ListenAndServe returns: 98020a3f63

Originally created by @abh on GitHub (Aug 31, 2012). Original GitHub issue: https://github.com/abh/geodns/issues/8 This is a followup to miekg/dns#21 (which really was about something else). I ran dnsbench against the [geodns](http://github.com/abh/geodns) server today to reproduce the "hang" where it just stops listening on UDP. After 4 hours of 1000qps it was still working fine and it's "only" doubled memory usage from 15MB to 30MB. Running `lsof` on the process shows it's doesn't have the UDP server open anymore. I've added some monitoring code in 70b6e4e413f8751678c2999e8a6d124c954676d3 and an attempt at logging if ListenAndServe returns: 98020a3f63515b4a
kerem closed this issue 2026-03-01 17:24:13 +03:00
Author
Owner

@miekg commented on GitHub (Aug 31, 2012):

Can it be that ServeUDP() is reading to much and returning. server.go lines 274-277. I could change that into a continue instead of a return...?

<!-- gh-comment-id:8184668 --> @miekg commented on GitHub (Aug 31, 2012): Can it be that ServeUDP() is reading to much and returning. server.go lines 274-277. I could change that into a continue instead of a return...?
Author
Owner

@abh commented on GitHub (Aug 31, 2012):

Maybe start with just making it a (loud) log warning and then I can see if it shows up. The server has enough different clients that it'll get the occasional completely non-sense request.

<!-- gh-comment-id:8184750 --> @abh commented on GitHub (Aug 31, 2012): Maybe start with just making it a (loud) log warning and then I can see if it shows up. The server has enough different clients that it'll get the occasional completely non-sense request.
Author
Owner

@miekg commented on GitHub (Aug 31, 2012):

Yeah, but I'm changing that anyhow. Because it makes the listener quit when it gets a weird packet - not something you want.

<!-- gh-comment-id:8184772 --> @miekg commented on GitHub (Aug 31, 2012): Yeah, but I'm changing that anyhow. Because it makes the listener quit when it gets a weird packet - not something you want.
Author
Owner

@abh commented on GitHub (Aug 31, 2012):

I confirmed that the problem was ListenAndServe returning. (I didn't get to upgrade last night before going to sleep).

I upgraded the test server now to use the latest dns version. I'm planning to move a couple more servers to the Go version over the weekend. Thanks for all the help!

<!-- gh-comment-id:8202924 --> @abh commented on GitHub (Aug 31, 2012): I confirmed that the problem was ListenAndServe returning. (I didn't get to upgrade last night before going to sleep). I upgraded the test server now to use the latest dns version. I'm planning to move a couple more servers to the Go version over the weekend. Thanks for all the help!
Author
Owner

@miekg commented on GitHub (Aug 31, 2012):

No problem. I have fun helping :) See latest pull request :) Actually debugging with dnsperf as we speak. I'll let it run for about 4 hours.

(Thanks for the close #N tip!)

<!-- gh-comment-id:8203167 --> @miekg commented on GitHub (Aug 31, 2012): No problem. I have fun helping :) See latest pull request :) Actually debugging with dnsperf as we speak. I'll let it run for about 4 hours. (Thanks for the close #N tip!)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/geodns#152
No description provided.