-
Notifications
You must be signed in to change notification settings - Fork 22
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
Goobs panics when trying to send a request after OBS has been closed #141
Comments
Hello! I was able to reproduce it.
You have the right idea. I added a Interestingly when I ran your example sometimes I got a clean exit from the request, and sometimes I got the panic. When running with
Here what seems to happen is the client got an And here it is when it panics:
Now here it's interesting because the client gets the After the fix it doesn't panic anymore:
|
I published a new release with the fix v1.2.3. Please lemme know if it works for you! And thank you for reporting this! I think this comment foreshadowed this issue #54 (comment) 👀:
|
I have tried it 5 times now and instead of a panic get an error returned: Very nice! |
Hey! It's me again.
Last time goobs was crashing OBS, now I found out how to crash goobs with OBS. 😅
All it takes is to close OBS:
Issue
Goobs panics following these steps:
goobs.New
Expected Result
An error is returned by goobs to be handled by the application.
Actual result
Goobs panics:
panic: send on closed channel goroutine 40 [running]: github.com/andreykaipov/goobs/api.(*Client).SendRequest(0xc0001829f0, {0xdd0580, 0x1016020}, {0xdd0f70, 0xc00019e780}) C:/Users/gambloide/go/pkg/mod/github.com/andreykaipov/goobs@v1.2.2/api/client.go:78 +0x2b2
Panicking code:
Code to reproduce the panic
Notes
SendRequest
function to prevent or recover from the panic, but my understanding of the internal of goobs and my general experience with go were not sufficient to identify a simple fix inside the method itself. But since something is closing/releasing theOpcodes
channel, the same something might be able to e.g. set a flag indicating the client to be in an unusable state, causingSendRequest
to return an error instead of trying to send down a closed channel?The text was updated successfully, but these errors were encountered: