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

Async exception tracking #962

Open
Menduist opened this issue Oct 12, 2023 · 3 comments
Open

Async exception tracking #962

Menduist opened this issue Oct 12, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@Menduist
Copy link
Contributor

Once status-im/nim-chronos#251 is merged, and some time has passed, we should start to integrate it in libp2p API

This will require to think long and hard about how we handle exceptions, and will probably catch a lot of exception bugs

While exception tracking can mostly be added in a backward-compatible manner, that is not the case for async callbacks (for instance, gossipsub validators). We can either breack backward compatibility (requires a 2.0), or just keep the callbacks unchecked (seems reasonable)

Also keep in mind that once exception tracking is in, adding new exceptions will break compatbilitly

@Menduist Menduist added the enhancement New feature or request label Oct 12, 2023
@Menduist Menduist mentioned this issue Oct 12, 2023
21 tasks
@arnetheduck
Copy link
Contributor

Also keep in mind that once exception tracking is in, adding new exceptions will break compatbilitly

Already breaks compatibility if raising a new type (except changes meaning in calling code), albeit at runtime instead of compile-time.

@arnetheduck
Copy link
Contributor

async raises have been merged in chronos, so this is now unblocked

@etan-status
Copy link
Contributor

Have started annotating {.async: (raises).}.

For callbacks, there's a way to allow handler = and new to still accept old-style callbacks while also accept ones that are tagged with (raises) by wrapping the new ones with the old one. That doesn't need a 2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: backlog
Development

No branches or pull requests

3 participants