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

Data Race when calling Server.SetText() from another goroutine. #33

Open
AhmadMuzakkir opened this issue Mar 27, 2018 · 0 comments
Open

Comments

@AhmadMuzakkir
Copy link

AhmadMuzakkir commented Mar 27, 2018

The Go Data Race Detector detects a data race.
More specifically, the data race is in Server.composeBrowsingAnswers().

	txt := &dns.TXT{
		Hdr: dns.RR_Header{
			Name:   s.service.ServiceInstanceName(),
			Rrtype: dns.TypeTXT,
			Class:  dns.ClassINET,
			Ttl:    s.ttl,
		},
		Txt: s.service.Text, // Data race here
	}

I think this is because the Server runs on it's own goroutine.
So when you modify the Service field from another goroutine, a data race will occur.

falanger pushed a commit to falanger/zeroconf that referenced this issue Sep 7, 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

No branches or pull requests

1 participant