http2 icon indicating copy to clipboard operation
http2 copied to clipboard

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

Open epoberezkin opened this issue 1 year ago • 2 comments

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 (https://github.com/kazu-yamamoto/http2/issues/37 - yet to test if it's fixed, sorry). But it's irrelevant for this issue, as it is at a lower level.

epoberezkin avatar Apr 25 '23 09:04 epoberezkin