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

Exception in streaming function does not cause exception in sending the request #75

Open
epoberezkin opened this issue Apr 25, 2023 · 2 comments

Comments

@epoberezkin
Copy link

There is no small code sample to demonstrate yet, we have a PR that shows the problem:

What happens is this:

  1. A streaming function that sends chunks throws the exception (in this case because the file is not present):

https://github.com/simplex-chat/simplexmq/pull/730/files#diff-aa7178f82f94f72876f42f9c0359c77d1a08aa0e84c2b34f15ce70506f873ed6R162

  1. The function that sends this request does not throw the exception:

https://github.com/simplex-chat/simplexmq/pull/730/files#diff-2b59839bb37bb7512686cd614a46a962ea285593a4b7c7478f8e88057f26b853R120

  1. instead, sending request fails because of the timeout here:

https://github.com/simplex-chat/simplexmq/pull/730/files#diff-2b59839bb37bb7512686cd614a46a962ea285593a4b7c7478f8e88057f26b853R141

For the context, the reason we use queues and TMVars to send requests and process responses is that the function to send the request returned by the library was not thread safe (#37 - yet to test if it's fixed, sorry). But it's irrelevant for this issue, as it is at a lower level.

@kazu-yamamoto
Copy link
Owner

I confirmed that Client throws an exception from its internal.
I guess you catch exceptions somewhere in your Client.

@kazu-yamamoto
Copy link
Owner

@epoberezkin You were talking about streaming while I tested with other types.
It was my bad.
You might want to joint the discussion in #77.

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

2 participants