We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
A race condition happens when opening a client
Here's the error
================== WARNING: DATA RACE Write at 0x00c000136140 by goroutine 7: github.com/james-barrow/golang-ipc.startClient() /Users/thomas/go/pkg/mod/github.com/james-barrow/[email protected]/client_all.go:63 +0x38 github.com/james-barrow/golang-ipc.StartClient.func1() /Users/thomas/go/pkg/mod/github.com/james-barrow/[email protected]/client_all.go:56 +0x34 Previous read at 0x00c000136140 by main goroutine: github.com/james-barrow/golang-ipc.(*Client).Write() /Users/thomas/go/pkg/mod/github.com/james-barrow/[email protected]/client_all.go:198 +0x4c main.startIPCClient() /Users/thomas/go/src/github.com/equals215/deepsentinel/agent/test-tbd/main.go:18 +0x9c main.main() /Users/thomas/go/src/github.com/equals215/deepsentinel/agent/test-tbd/main.go:10 +0x20 Goroutine 7 (running) created at: github.com/james-barrow/golang-ipc.StartClient() /Users/thomas/go/pkg/mod/github.com/james-barrow/[email protected]/client_all.go:56 +0x388 main.startIPCClient() /Users/thomas/go/src/github.com/equals215/deepsentinel/agent/test-tbd/main.go:14 +0x58 main.main() /Users/thomas/go/src/github.com/equals215/deepsentinel/agent/test-tbd/main.go:10 +0x20 ================== Found 1 data race(s) exit status 66
Here's the code that trigger this race condition :
package main import ( "fmt" ipc "github.com/james-barrow/golang-ipc" ) func main() { startIPCClient() } func startIPCClient() (*ipc.Client, error) { c, err := ipc.StartClient("testIPC", &ipc.ClientConfig{Timeout: 500}) if err != nil { return nil, err } c.Write(1, []byte("ping")) resp, err := c.Read() if err != nil { return nil, err } if string(resp.Data) != "pong" { return nil, fmt.Errorf("unexpected response: %s", resp.Data) } return c, nil }
The text was updated successfully, but these errors were encountered:
Abandoned the use of this package, letting this issue open for the sake of it. Won't provide help.
Sorry, something went wrong.
fixing race conditions using mutex locks related to github.com/james-…
13d0e21
…barrow/golang-ipc/issues/23
No branches or pull requests
A race condition happens when opening a client
Here's the error
Here's the code that trigger this race condition :
The text was updated successfully, but these errors were encountered: