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

Properly expose errors/exceptions #49

Open
lucasdicioccio opened this issue Nov 19, 2017 · 3 comments
Open

Properly expose errors/exceptions #49

lucasdicioccio opened this issue Nov 19, 2017 · 3 comments

Comments

@lucasdicioccio
Copy link
Member

It's about time we start exposing errors and exception to API users.
The new dispatch mechanism allows to have fewer entry points, which makes the exception handling tracktable.

There are two broad types of errors we may want to catch and expose differently:

  • connection errors (e.g., dead endpoint) and goaways
  • individual stream resets

Currently the design was mostly ad-hoc, with a mix of HTTP2 errors and uncaught exeptions.

@lucasdicioccio
Copy link
Member Author

I've added a schema of the current threading+error propagation model, showing a risk of leaking low-level asyncs if a remote/the kernel does not close TCP and no-one called an explicit close on the RawConnection object.

https://docs.google.com/presentation/d/1WxP7HkTHy7Rr8sA-9NydD5jRcWbFffW2yM4Pv61OCfI/edit?usp=sharing

The schema doesn't go in some level of detail (e.g., using race around the IncomingLoop to handle cancellation gracefully so that the 'pollSTM' error does not bubble up on a client-initiated close -- cf. #56 .)

@lucasdicioccio
Copy link
Member Author

The branch https://github.com/lucasdicioccio/http2-client/tree/stop-polling-on-eof is already likely adding an ExceptT layer to collect exceptions, currently hiding everything out of the existing user-facing APIs.

@lucasdicioccio
Copy link
Member Author

#67 Has done much of the basics needed for this.
More work is required for synchronized error handling across threads (for now it's unclear who-gets-what-errors on an exception and, as far as I can tell, users should carefully link asyncs to be double safe).

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

1 participant