go-socket.io icon indicating copy to clipboard operation
go-socket.io copied to clipboard

broadcast.lock.Lock(), sometimes can't lock in function join

Open AngleMAXIN opened this issue 6 years ago • 1 comments

Describe the bug When my two devices want to connect to the service, the join function will be stuck in the lock, the entire service is stuck there, unless I restart the service. Of course, this situation rarely occurs.

It should be that the lock is not released, deadlocked To Reproduce `

// Join joins the given connection to the broadcast room func (broadcast *broadcast) Join(room string, connection Conn) { // get write lock fmt.Println("==================================1") broadcast.lock.Lock() fmt.Println("==================================2") defer broadcast.lock.Unlock()

` Expected behavior A clear and concise description of what you expected to happen.

Environment (please complete the following information):

  • Go version: [e.g. v1.12]
  • Server version [e.g. go-socket.io v1.4.3-0.20191016204530-42fe90fa9ed0]
  • Client version [e.g. socket.io v1.4]

AngleMAXIN avatar Oct 25 '19 07:10 AngleMAXIN

This bug also occurred to me. Can i help to solve this issue? @AngleMAXIN

smhmh avatar Aug 29 '22 08:08 smhmh