Skip to content

client.Do() is not safe for concurrent use #31

@gnuletik

Description

@gnuletik

During automated tests, that runs concurrent rdap queries, I've seen the following panic:

github.com/openrdap/rdap/bootstrap.(*Client).Lookup(0xc00118e690, 0xc000e80960)
	/home/actions-runner/go/pkg/mod/github.com/openrdap/rdap@v0.9.1/bootstrap/client.go:340 +0x4d4
github.com/openrdap/rdap.(*Client).Do(0xc000427bf0, 0xc000e923c0)
	/home/actions-runner/go/pkg/mod/github.com/openrdap/rdap@v0.9.1/client.go:150 +0x4c5

I was able to reproduce this issue locally while running

$ go test -race
==================
WARNING: DATA RACE
Read at 0x00c00047acc0 by goroutine 33:
  github.com/openrdap/rdap.(*Client).Do()
...

Previous write at 0x00c00047acc0 by goroutine 40:
  github.com/openrdap/rdap.(*Client).Do()
      /home/actions-runner/go/pkg/mod/github.com/openrdap/rdap@v0.9.1/client.go:96 +0xe4

Would it be possible to make the client.Do function safe for concurrent use?
If not, would it be possible to show it in the documentation?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions