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

"Invalid subscription" panic in runtime_service #2190

Closed
tomaka opened this issue Mar 31, 2022 · 3 comments · Fixed by #2621
Closed

"Invalid subscription" panic in runtime_service #2190

tomaka opened this issue Mar 31, 2022 · 3 comments · Fixed by #2621

Comments

@tomaka
Copy link
Contributor

tomaka commented Mar 31, 2022

When starting the demo and connecting to Polkadot, Kusama and Westend all together, I occasionally have a panic here:

panic!("Invalid subscription")

@tomaka
Copy link
Contributor Author

tomaka commented Mar 31, 2022

So this is actually subtle.

If the sync service closes the blocks subscription, the runtime service also automatically closes all its active block subscriptions, which makes sense.
But when doing so, the runtime service automatically unpins all the blocks that were pinned by these subscriptions.
The problem is that, in parallel, another piece of code on top of the runtime service isn't aware of the fact that the subscription has been killed and tries to use the pinned blocks. This leads to this panic.

@melekes
Copy link
Contributor

melekes commented Apr 27, 2022

The problem is that, in parallel, another piece of code on top of the runtime service isn't aware of the fact that the subscription has been killed and tries to use the pinned blocks.

And the solution is for "another piece of code" to check if the block they are trying to use is still pinned or not, isn't it?

@tomaka
Copy link
Contributor Author

tomaka commented Apr 27, 2022

This is a good solution from the point of view of the runtime service, but it's not clear to me whether the API users would be able to handle this error properly.

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 a pull request may close this issue.

2 participants