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
Potential go routine on blocking functions #623
Comments
➤ Automation for Jira commented: The link to the corresponding Jira issue is https://ably.atlassian.net/browse/SDK-3855 |
Hi @davidrenne we have intentionally kept public methods as blocking in nature. |
This also means, that if you don't want to wait till the call to return, you have to implement your own mechanism to handle success/failure of the operation asynchronously. |
@davidrenne let us know if you have any updates on this, otherwise, we will close the issue |
In the case of an accidental blocked thread where the calling function has incorrect or bad code:
https://github.com/ably/ably-go/blob/main/ably/realtime_channel.go#L512
An entire set of messages will be blocked forever. Do you think you can add a go routine for this to prevent this? I realize every 1 payload will be a go routine, but perhaps you can call the function callback and timeout to kill the go routine somehow if it doesnt return in a certain number of seconds?
It wasnt inherently obvious that these callbacks are synchronous and thus if I have 1 payload which incorrectly hangs a channel without a select timeout, my entire servers pub sub goes down. Now I have added selects and timeouts if the channel is gone so that these things clear. So hopefully it solves my problem overall, but I saw this code and wanted to have a discussion about strategies or documentation around a blocking function call that can ruin an entire servers pubsub.
The text was updated successfully, but these errors were encountered: