Skip to content

Deadlock issue #11

Description

@henrymkw

This happened when multiple clients logged out/shutdown simultaneously.

Log:

POTENTIAL DEADLOCK: Inconsistent locking. saw this ordering in one goroutine:
happened before
gpcm/friend.go:92 gpcm.(*GameSpySession).addFriend { mutex.Lock() } <<<<<
~/go/pkg/mod/github.com/sasha-s/go-deadlock@v0.3.5/deadlock.go:87 go-deadlock.(*Mutex).Lock { func (m *Mutex) Lock() { }
gpcm/main.go:282 gpcm.(*GameSpySession).handleCommand {  }
gpcm/main.go:249 gpcm.HandlePacket { commands = session.handleCommand("status", commands, session.setStatus) }
main.go:182 main.(*RPCPacket).HandlePacket { case "gpcm": }
/usr/lib/golang/src/reflect/value.go:583 reflect.Value.call { // For testing; see TestCallMethodJump. }
/usr/lib/golang/src/reflect/value.go:364 reflect.Value.Call { v.mustBeExported() }
/usr/lib/golang/src/net/rpc/server.go:384 rpc.(*service).call { // The return value for the method is an error. }

happened after
qr2/logins.go:124 qr2.AddToFriendsList { mutex.Lock() } <<<<<
~/go/pkg/mod/github.com/sasha-s/go-deadlock@v0.3.5/deadlock.go:87 go-deadlock.(*Mutex).Lock { func (m *Mutex) Lock() { }
gpcm/friend.go:110 gpcm.(*GameSpySession).addFriend { // Check if destination has added the sender }
gpcm/main.go:282 gpcm.(*GameSpySession).handleCommand {  }
gpcm/main.go:249 gpcm.HandlePacket { commands = session.handleCommand("status", commands, session.setStatus) }
main.go:182 main.(*RPCPacket).HandlePacket { case "gpcm": }
/usr/lib/golang/src/reflect/value.go:583 reflect.Value.call { // For testing; see TestCallMethodJump. }
/usr/lib/golang/src/reflect/value.go:364 reflect.Value.Call { v.mustBeExported() }
/usr/lib/golang/src/net/rpc/server.go:384 rpc.(*service).call { // The return value for the method is an error. }

in another goroutine: happened before
qr2/heartbeat.go:73 qr2.heartbeat { mutex.Lock() } <<<<<
~/go/pkg/mod/github.com/sasha-s/go-deadlock@v0.3.5/deadlock.go:87 go-deadlock.(*Mutex).Lock { func (m *Mutex) Lock() { }
qr2/main.go:200 qr2.handleConnection { // logging.Info(moduleName, "Command:", aurora.Yellow("HEARTBEAT")) }

happened after
gpcm/main.go:115 gpcm.CloseConnection { mutex.Lock() } <<<<<
~/go/pkg/mod/github.com/sasha-s/go-deadlock@v0.3.5/deadlock.go:87 go-deadlock.(*Mutex).Lock { func (m *Mutex) Lock() { }
main.go:198 main.(*RPCPacket).CloseConnection { case "gpcm": }
/usr/lib/golang/src/reflect/value.go:583 reflect.Value.call { // For testing; see TestCallMethodJump. }
/usr/lib/golang/src/reflect/value.go:364 reflect.Value.Call { v.mustBeExported() }
/usr/lib/golang/src/net/rpc/server.go:384 rpc.(*service).call { // The return value for the method is an error. }

Other goroutines holding locks:
goroutine 824638926784 lock 0xf09398
qr2/heartbeat.go:73 qr2.heartbeat { mutex.Lock() } <<<<<
~/go/pkg/mod/github.com/sasha-s/go-deadlock@v0.3.5/deadlock.go:87 go-deadlock.(*Mutex).Lock { func (m *Mutex) Lock() { }
qr2/main.go:200 qr2.handleConnection { // logging.Info(moduleName, "Command:", aurora.Yellow("HEARTBEAT")) }



2026/06/06 06:55:02 E[FRONTEND]: Failed to forward close connection to backend: unexpected EOF
2026/06/06 06:55:03 E[FRONTEND]: Failed to forward close connection to backend: connection is shut down

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions