You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
func (s *TestService) FuncB() error {
//get the rpcClient's write lock
go func() {
client.DefaultClient.Init()
}()
//rpc call 127.0.0.1 node's funcC,
//rpcClient's mu read lock re-entry then deadlock
client.DefaultClient.Call(
context.Background(),
client.NewRequest("TestService", "TestService.FuncC", nil),
nil,
client.WithAddress("127.0.0.1:8080"),
)
return nil
}
func (s *TestService) FuncC() error {
return nil
}
func TestRpcClient(t *testing.T) {
s := &TestService{}
go func() {
s.FuncA()
}()
time.Sleep(time.Minute)
}
The text was updated successfully, but these errors were encountered:
yuan0763
changed the title
[BUG]rpc_client.go Call function easily happen RWMutex‘s read lock re-entry then deadlock
[BUG]V4.10.2 rpc_client.go Call function easily happen RWMutex‘s read lock re-entry then deadlock
Apr 25, 2024
example:
type TestService struct {
}
func (s *TestService) FuncA() error {
//rpc call 127.0.0.1 node's funcB
client.DefaultClient.Call(
context.Background(),
client.NewRequest("TestService", "TestService.FuncB", nil),
nil,
client.WithAddress("127.0.0.1:8080"),
)
return nil
}
func (s *TestService) FuncB() error {
//get the rpcClient's write lock
go func() {
client.DefaultClient.Init()
}()
//rpc call 127.0.0.1 node's funcC,
//rpcClient's mu read lock re-entry then deadlock
client.DefaultClient.Call(
context.Background(),
client.NewRequest("TestService", "TestService.FuncC", nil),
nil,
client.WithAddress("127.0.0.1:8080"),
)
return nil
}
func (s *TestService) FuncC() error {
return nil
}
func TestRpcClient(t *testing.T) {
s := &TestService{}
}
The text was updated successfully, but these errors were encountered: