Skip to content
New issue

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

race #182

Open
Vany opened this issue Oct 25, 2024 · 3 comments
Open

race #182

Vany opened this issue Oct 25, 2024 · 3 comments

Comments

@Vany
Copy link

Vany commented Oct 25, 2024

i start reading from .IncomingEvents

Write at 0x00c0003166a0 by goroutine 90:
  runtime.recvDirect()
      /Users/vany/sdk/go1.23.2/src/runtime/chan.go:388 +0x7c
  github.com/andreykaipov/goobs.(*Client).handleRawServerMessages.(*Client).markDisconnected.func1()
      /Users/vany/go/pkg/mod/github.com/andreykaipov/goobs@v1.5.1/client.go:142 +0xcc
  sync.(*Once).doSlow()
      /Users/vany/sdk/go1.23.2/src/sync/once.go:76 +0xac
  sync.(*Once).Do()
      /Users/vany/sdk/go1.23.2/src/sync/once.go:67 +0x40
  github.com/andreykaipov/goobs.(*Client).markDisconnected()
      /Users/vany/go/pkg/mod/github.com/andreykaipov/goobs@v1.5.1/client.go:135 +0x6d4
  github.com/andreykaipov/goobs.(*Client).handleRawServerMessages()
      /Users/vany/go/pkg/mod/github.com/andreykaipov/goobs@v1.5.1/client.go:253 +0x6a0
  github.com/andreykaipov/goobs.(*Client).connect.gowrap1()
      /Users/vany/go/pkg/mod/github.com/andreykaipov/goobs@v1.5.1/client.go:212 +0x40

Previous read at 0x00c0003166a0 by goroutine 91:
  runtime.chansend1()
      /Users/vany/sdk/go1.23.2/src/runtime/chan.go:157 +0x2c
  github.com/andreykaipov/goobs.(*Client).writeEvent()
      /Users/vany/go/pkg/mod/github.com/andreykaipov/goobs@v1.5.1/client.go:378 +0x748
  github.com/andreykaipov/goobs.(*Client).handleOpcodes()
      /Users/vany/go/pkg/mod/github.com/andreykaipov/goobs@v1.5.1/client.go:351 +0x6c0
  github.com/andreykaipov/goobs.(*Client).connect.gowrap2()
      /Users/vany/go/pkg/mod/github.com/andreykaipov/goobs@v1.5.1/client.go:213 +0x40
@xaionaro
Copy link
Contributor

xaionaro commented Oct 25, 2024

Hey! These problems are supposed to be fixed here: #179 (you can try to use the temporary repo with the fixes: https://github.com/xaionaro-go/goobs; it will be deleted if the fixed will be merged)

@andreykaipov
Copy link
Owner

I feel like with how many concurrency issues crop up despite several attempts of PRs in the past to remediate those issues, it's really tempting to just pass on the burden of handling concurrency to client applications like gorilla/websocket has done.

I've never used this library extensively enough to bump into concurrency issues so I don't have a strong understanding of what's going on here, and without being able to reproduce it - it's difficult to provide a resolution unfortunately.

Let me know if @xaionaro's fix helps. I've also merged in another of their PRs #180, but the stracktraces look different enough that I don't think it will help.

@andreykaipov
Copy link
Owner

I cut a new release with @xaionaro's latest fixes https://github.com/andreykaipov/goobs/releases/tag/v1.5.2. I hope it can help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants