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

Hang due to Slow DB #66

Closed
TheBlueMatt opened this issue Nov 19, 2023 · 2 comments
Closed

Hang due to Slow DB #66

TheBlueMatt opened this issue Nov 19, 2023 · 2 comments

Comments

@TheBlueMatt
Copy link
Contributor

So while we'd previously fixed hang issues, there's still one remaining: if the DB backs up and we start blocking in the peer message handler, that's fine, except that its holding the peer read lock in LDK's peer_handler. Because that's a sync lock, any future calls into LDK's peer_handler which require the same peer's lock or a total peer write lock will immediately block until the DB catches up. That's all fine, unless there's enough work going on in the peer_handler to block enough tokio tasks that we no longer make progress on the DB, which can happen if there's lots of connections churning or not very many threads.

Not sure how to solve this, it may ultimately need a may-block-on-async flag in lightning-net-tokio, which would then make lightning-net-tokio much less efficient by calling block_in_place, but would allow this type of application.

@TheBlueMatt
Copy link
Contributor Author

We should be running the postgres queries on a separate runtime.

@TheBlueMatt
Copy link
Contributor Author

Fixed #73.

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