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

feat(ipld): wrap bindnode with panic protection #368

Merged
merged 2 commits into from
Mar 29, 2022

Conversation

rvagg
Copy link
Member

@rvagg rvagg commented Mar 16, 2022

I meant to do this earlier but got stuck with other things. Just simple panic protection around bindnode use since bindnode is so new and we're still ironing out issues with it.

@rvagg rvagg requested review from mvdan and willscott March 16, 2022 05:45
Copy link
Contributor

@mvdan mvdan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a problem with this change, though I was thinking that graphsync would add a recover on every goroutine that handles a user's request asynchronously. That's akin to what net/http does: it spawns a goroutine to handle each HTTP request, and if any of it panics, then it doesn't bring the entire server down.

Recovering around bindnode is still better than no recover at all, but it doesn't cover us for the other thirty moving pieces: codecs, ipld-prime, car, etc.

@rvagg
Copy link
Member Author

rvagg commented Mar 16, 2022

mm, but I'm not sure that approach is going to work, or at least it might be difficult to pull off, since graphsync maintains pools of workers for some tasks and shared workers for others; it's not as straightforward as one overarching goroutine per request.

@mvdan
Copy link
Contributor

mvdan commented Mar 16, 2022

That's fair, I just wanted to point that out. Being safe from bindnode panics is nice, but it's not the only worrying part of graphsync :)

Copy link
Contributor

@mvdan mvdan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with the caveats above :)

@rvagg rvagg requested a review from hannahhoward March 28, 2022 04:29
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

Successfully merging this pull request may close these issues.

3 participants