Skip to content

race condition when running https + http #2277

Answered by mikerott
mikerott asked this question in Q&A
Discussion options

You must be logged in to vote

At this point I'm wondering if the hm *hybrid.HybridMap in fastdialer/dialer.go.Dialer is thread (errr "go routine") safe, or if the cache needs more protection against bad entries.

I've added some print statements, like:

	// check if data is in cache
	data, err := d.GetDNSData(hostname)
	if err != nil {
		// otherwise attempt to retrieve it
		data, err = d.dnsclient.Resolve(hostname)
	} else if data != nil {
		fmt.Printf("MIKE %s: it was in the cache as %v or %v\n", mikePrefix, data.A, data.AAAA)
	}

And the output occasionally shows:

2022-07-12T16:38:38.631000+00:00 2022/07/12/[LATEST]db5e9a81 MIKE reg: it was in the cache as [] or []

... which implies the cache has been populated with…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by mikerott
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant